|
| 1 | +version: "2" |
| 2 | +linters: |
| 3 | + enable: |
| 4 | + # Commented entries here are not enabled by default, but that we should |
| 5 | + # add once the relevant lines are fixed up. |
| 6 | + |
| 7 | + # - errorlint # found 2 cases to be fixed. |
| 8 | + # - exhaustive # found some cases that should be fixed. |
| 9 | + # - exhaustruct # found some structs which missed fields in initializing. |
| 10 | + # - inamedparam # fix missing named param |
| 11 | + # - makezero # fix the unallocated elements. |
| 12 | + # - misspell # fix spelling |
| 13 | + # - nlreturn # fix these missing blank line |
| 14 | + # - nonamedreturns # found some shadowing |
| 15 | + # - predeclared # found some shadowing |
| 16 | + # - revive # detects a number of good fixes |
| 17 | + # - thelper # fix test methods with t.Testing not as first param |
| 18 | + - unconvert |
| 19 | + # - wastedassign # fix and enable |
| 20 | + # - whitespacew # fix and enable |
| 21 | + disable: |
| 22 | + # A number of these checks run by default so they are explicitly |
| 23 | + # disabled here. |
| 24 | + # |
| 25 | + # Other of these checks are disabled by default, but we want to |
| 26 | + # comment on why we plan to keep them excluded going forward. |
| 27 | + # |
| 28 | + # TODO(rsned): Move the checks to enable: once the flagged |
| 29 | + # problems are resolved for each check. |
| 30 | + # https://github.com/golang/geo/issues/145 |
| 31 | + |
| 32 | + # Enable once we reduce the cleverness with unicode chars. |
| 33 | + # Identifier "ε" contain non-ASCII character: U+03B5 'ε' |
| 34 | + - asciicheck |
| 35 | + # TODO(rsned): This should be enabled once we define the appropriate |
| 36 | + # list of acceptable external imports. (e.g. should only be trusted |
| 37 | + # verifiable sources) |
| 38 | + - depguard |
| 39 | + # Enable once we fix the detected doubled words. |
| 40 | + # e.g. Duplicate words (bound) found (dupword) |
| 41 | + # // 3. Best asymptotic bound: This bound bound is derived by |
| 42 | + - dupword |
| 43 | + # Enable once outstanding lint bugs are fixed. |
| 44 | + - errcheck |
| 45 | + # This check is not necessary as we only use types internally that we |
| 46 | + # fully control so we do not expect type assertion failures. |
| 47 | + - forcetypeassert |
| 48 | + # Enable once these are fixed. |
| 49 | + # goconst found a few instances where repeated values could be const-ified. |
| 50 | + - goconst |
| 51 | + # Enable once these are fixed. |
| 52 | + # gocritic suggests a number of code cleanups to be implemented. |
| 53 | + - gocritic |
| 54 | + # There are too many package globals constants and types used in s2. |
| 55 | + # (lookup tables and such) |
| 56 | + - gochecknoglobals |
| 57 | + # Enable once these are all fixed. |
| 58 | + # gosec detects a bunch of unsafe integer conversions. |
| 59 | + - gosec |
| 60 | + # This triggers on many many of the math values chosen by S2. |
| 61 | + # e.g., Magic number: 2, in <argument> detected (mnd) |
| 62 | + # math.Remainder(i.Lo-margin, 2*math.Pi), |
| 63 | + # Not clear if these are every likely to be all fixed so leave |
| 64 | + # this check disabled. |
| 65 | + # TODO(rsned): Enable manually once in a while to look for any |
| 66 | + # actually fixable cases. |
| 67 | + - mnd |
| 68 | + # Triggers on most tests for failing to call paralleltest. |
| 69 | + # We don't have a need to use this so keep it disabled. |
| 70 | + - paralleltest |
| 71 | + # Enable once outstanding lint bugs are fixed. |
| 72 | + - staticcheck |
| 73 | + # This triggers on every _test file saying they should be separate |
| 74 | + # parallel packages e.g. s2->s2_test package. We do not plan to ever |
| 75 | + # reshuffle the tests into a separate package. |
| 76 | + - testpackage |
| 77 | + # This triggers on many parts written in advance of the code that |
| 78 | + # actually calls them. It may occasionally find some real unused |
| 79 | + # code so running it by hand once in while could be useful. |
| 80 | + - unused |
| 81 | +formatters: |
| 82 | + enable: |
| 83 | + - gofmt |
| 84 | + - goimports |
0 commit comments