Skip to content

Commit

Permalink
don't report symbol parse failures in lint test
Browse files Browse the repository at this point in the history
  • Loading branch information
kritzcreek committed Jun 26, 2024
1 parent 90f7f9d commit d85f5e4
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
9 changes: 7 additions & 2 deletions cmd/scip/lint.go
Original file line number Diff line number Diff line change
Expand Up @@ -240,14 +240,19 @@ func (st *symbolTable) addOccurrence(path string, occ *scip.Occurrence) error {
return nil
}

// SkipLintSymbolParseTest is only set to true in the tests to allow using more succinct symbols
var SkipLintSymbolParseTest = false

func lintSymbolString(symbol string, context string) error {
if symbol == "" {
return emptyStringError{what: "symbol", context: context}
}
sym, err := scip.ParseSymbol(symbol)
if err != nil {
// TODO: This should be linted (but it makes all the tests fail)
return nil
if SkipLintSymbolParseTest {
return nil
}
return err
}
formatted := scip.VerboseSymbolFormatter.FormatSymbol(sym)
if symbol != formatted {
Expand Down
1 change: 1 addition & 0 deletions cmd/scip/lint_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,7 @@ type testCase struct {
}

func TestErrors(t *testing.T) {
SkipLintSymbolParseTest = true
var testCases []testCase

testCases = []testCase{
Expand Down

0 comments on commit d85f5e4

Please sign in to comment.