|
| 1 | +# options for analysis running |
| 2 | +run: |
| 3 | + deadline: 20s |
| 4 | + tests: true |
| 5 | + skip-dirs: |
| 6 | + - generated |
| 7 | + skip-files: |
| 8 | + - ".*\\.pb\\.go" |
| 9 | + silent: true |
| 10 | + |
| 11 | +# output configuration options |
| 12 | +output: |
| 13 | + format: colored-line-number |
| 14 | + print-issued-lines: true |
| 15 | + print-linter-name: true |
| 16 | + |
| 17 | +# all available settings of specific linters |
| 18 | +linters-settings: |
| 19 | + errcheck: |
| 20 | + check-type-assertions: true |
| 21 | + check-blank: true |
| 22 | + govet: |
| 23 | + check-shadowing: false |
| 24 | + disable: |
| 25 | + - shadow |
| 26 | + gofmt: |
| 27 | + simplify: true |
| 28 | + goconst: |
| 29 | + min-len: 3 |
| 30 | + min-occurrences: 3 |
| 31 | + misspell: |
| 32 | + locale: UK |
| 33 | + ignore-words: |
| 34 | + - statuser |
| 35 | + unused: |
| 36 | + check-exported: true |
| 37 | + unparam: |
| 38 | + algo: cha |
| 39 | + nakedret: |
| 40 | + max-func-lines: 30 |
| 41 | + prealloc: |
| 42 | + simple: true |
| 43 | + range-loops: true |
| 44 | + for-loops: true |
| 45 | + |
| 46 | +linters: |
| 47 | + enable: |
| 48 | + - golint # Golint differs from gofmt. Gofmt reformats Go source code, whereas golint prints out style mistakes [fast: true] |
| 49 | + - misspell # Finds commonly misspelled English words in comments [fast: true] |
| 50 | + - nakedret # Finds naked returns in functions greater than a specified function length [fast: true] |
| 51 | + - errcheck # Errcheck is a program for checking for unchecked errors in go programs. These unchecked errors can be critical bugs in some cases [fast: false] |
| 52 | + - gas # Inspects source code for security problems [fast: false] |
| 53 | + - structcheck # Finds an unused struct fields [fast: false] |
| 54 | + - unconvert # Remove unnecessary type conversions [fast: false] |
| 55 | + - unparam # Reports unused function parameters [fast: false] |
| 56 | + - goimports # Goimports does everything that gofmt does. Additionally it checks unused imports [fast: true] |
| 57 | + - lll # Reports long lines [fast: true] |
| 58 | + - megacheck # 3 sub-linters in one: unused, gosimple and staticcheck [fast: false] |
| 59 | + |
| 60 | + disable: |
| 61 | + - staticcheck # (megacheck) Staticcheck is a go vet on steroids, applying a ton of static analysis checks [fast: false] |
| 62 | + - prealloc # Finds slice declarations that could potentially be preallocated [fast: true] |
| 63 | + - unused # (megacheck) Checks Go code for unused constants, variables, functions and types [fast: false] |
| 64 | + - gosimple # (megacheck) Linter for Go source code that specializes in simplifying a code [fast: false] |
| 65 | + - gofmt # Gofmt checks whether code was gofmt-ed. By default this tool runs with -s option to check for code simplification [fast: true] |
| 66 | + - dupl # Tool for code clone detection [fast: true] |
| 67 | + - typecheck # Like the front-end of a Go compiler, parses and type-checks Go code [fast: false] |
| 68 | + - depguard # Go linter that checks if package imports are in a list of acceptable packages [fast: false] |
| 69 | + - varcheck # Finds unused global variables and constants [fast: false] |
| 70 | + - deadcode # Finds unused code [fast: false] |
| 71 | + - goconst # Finds repeated strings that could be replaced by a constant [fast: true] |
| 72 | + - gocyclo # Computes and checks the cyclomatic complexity of functions [fast: true] |
| 73 | + - maligned # Tool to detect Go structs that would take less memory if their fields were sorted [fast: false] |
| 74 | + |
| 75 | +issues: |
| 76 | + exclude-use-default: false |
| 77 | + exclude-rules: |
| 78 | + - linters: |
| 79 | + - lll |
| 80 | + source: "github.com/utilitywarehouse/ordering-platform" |
| 81 | + exclude: |
| 82 | + # errcheck: Almost all programs ignore errors on these functions and in most cases it's ok |
| 83 | + - Error return value of |
| 84 | + .((os\.)?std(out|err)\..*|.*Close|.*Flush|os\.Remove(All)?|.*printf?|os\.(Un)?Setenv|.*Disconnect). |
| 85 | + is not checked |
| 86 | + |
| 87 | + # golint: Exported variables are rarely used and generally reserved for errors which should be self explanitory |
| 88 | + - exported var \w+ should have comment or be unexported |
| 89 | + |
| 90 | + # golint: False positive when tests are defined in package 'test' |
| 91 | + - func name will be used as test\.Test.* by other packages, and that |
| 92 | + stutters; consider calling this |
| 93 | + |
| 94 | + # gas: Too many false-positives on 'unsafe' usage |
| 95 | + - Use of unsafe calls should be audited |
| 96 | + |
| 97 | + # gas: Too many false-positives for parametrized shell calls |
| 98 | + - Subprocess launch(ed with variable|ing should be audited) |
| 99 | + |
| 100 | + # gas: Duplicated errcheck checks |
| 101 | + - G104 |
| 102 | + |
| 103 | + # gas: Too many issues in popular repos |
| 104 | + - (Expect directory permissions to be 0750 or less|Expect file permissions |
| 105 | + to be 0600 or less) |
| 106 | + |
| 107 | + # gas: False positive is triggered by 'src, err := ioutil.ReadFile(filename)' |
| 108 | + - Potential file inclusion via variable |
| 109 | + |
| 110 | + # govet: Common false positives |
| 111 | + - (possible misuse of unsafe.Pointer|should have signature) |
| 112 | + |
| 113 | + # megacheck: Developers tend to write in C-style with an explicit 'break' in a 'switch', so it's ok to ignore |
| 114 | + - ineffective break statement. Did you mean to break out of the outer loop |
| 115 | + |
| 116 | + # disable comments |
| 117 | + - exported [a-z]+ `?[^ ]+ should have comment |
0 commit comments