New 🌊 wave for @helm

Commit 3adf8f75

3adf8f7522c1Merged

Svyatoslav Dumchenko <[email protected]> · 4 years ago · 8 files · ~8 modified

Description

Fix linter issues

Details

Commit
3adf8f7522c1
Parent
cf9c8d4ff56f

.golangci.ymlmodifiedView file

@@ -4,27 +4,26 @@
44 build-tags:
55 - integration
66
7+output:
8+ # sorts results by: filepath, line and column
9+ sort-results: true
10+
711 linters:
812 enable-all: true
913 disable:
10- - cyclop
11- - funlen
12- - gci
1314 - gochecknoglobals # TODO: get rid of globals
14- - gocognit
15- - gocyclo
16- - godox
17- - goerr113
15+ - gocyclo # we use cyclop
16+ - godox # TODO: get rid of TODOs
17+ - goerr113 # need to create wrapped static errors
1818 - goimports # we already lint with gofumpt
1919 - golint # deprecated
2020 - gomnd # we want to keep magic numbers
21- - ifshort
2221 - interfacer # deprecated
2322 - maligned # deprecated
23+ - revive # we need a lot of documentation for exported things
2424 - scopelint # deprecated
25- - tagliatelle
26- - varnamelen
27- - wrapcheck
25+ - varnamelen # I don't think short names are bad
26+ - wrapcheck # TODO: need to wrap all external errors into our own
2827 - wsl # lots of style checks
2928
3029 # all available settings of specific linters
@@ -32,11 +31,11 @@
3231
3332 cyclop:
3433 # the maximal code complexity to report
35- max-complexity: 10
34+ max-complexity: 20
3635 # the maximal average package complexity. If it's higher than 0.0 (float) the check is enabled (default 0.0)
3736 package-average: 0.0
3837 # should ignore tests (default false)
39- skip-tests: false
38+ skip-tests: true
4039
4140 dogsled:
4241 # checks assignments with too many blank identifiers; default is 2
@@ -99,7 +98,7 @@
9998
10099 gocognit:
101100 # minimal code complexity to report, 30 by default (but we recommend 10-20)
102- min-complexity: 10
101+ min-complexity: 20
103102
104103 nestif:
105104 # minimal complexity of if statements to report, 5 by default
@@ -161,10 +160,6 @@
161160 # whether to check exported functions
162161 checkExported: true
163162
164- gocyclo:
165- # minimal code complexity to report, 30 by default (but we recommend 10-20)
166- min-complexity: 10
167-
168163 gofmt:
169164 # simplify code: gofmt with `-s` option, true by default
170165 simplify: true
@@ -315,6 +310,16 @@
315310 # https://staticcheck.io/docs/options#http_status_code_whitelist
316311 http-status-code-whitelist: [ "200", "400", "404", "500" ]
317312
313+ tagliatelle:
314+ # check the struck tag name case
315+ case:
316+ # use the struct field name to check the name of the struct tag
317+ use-field-name: false
318+ rules:
319+ # any struct tag type can be used.
320+ # support string case: `camel`, `pascal`, `kebab`, `snake`, `goCamel`, `goPascal`, `goKebab`, `goSnake`, `upper`, `lower`
321+ yaml: snake
322+
318323 testpackage:
319324 # regexp pattern to skip files
320325 skip-regexp: (export|internal)_test\.go
@@ -349,6 +354,27 @@
349354 multi-if: false # Enforces newlines (or comments) after every multi-line if statement
350355 multi-func: false # Enforces newlines (or comments) after every multi-line function signature
351356
357+issues:
358+ # Independently from option `exclude` we use default exclude patterns,
359+ # it can be disabled by this option. To list all
360+ # excluded by default patterns execute `golangci-lint run --help`.
361+ # Default value for this option is true.
362+ exclude-use-default: false
363+
364+ # Maximum issues count per one linter. Set to 0 to disable. Default is 50.
365+ max-issues-per-linter: 0
366+
367+ # Maximum count of issues with the same text. Set to 0 to disable. Default is 3.
368+ max-same-issues: 0
369+
370+ # Show only new issues: if there are unstaged changes or untracked files,
371+ # only those changes are analyzed, else only changes in HEAD~ are analyzed.
372+ # It's a super-useful option for integration of golangci-lint into existing
373+ # large codebase. It's not practical to fix all existing issues at the moment
374+ # of integration: much better don't allow issues in new code.
375+ # Default is false.
376+ new: false
377+
352378 severity:
353379 # Default value is empty string.
354380 # Set the default severity for issues. If severity rules are defined and the issues
@@ -363,3 +389,13 @@
363389 # The default value is false.
364390 # If set to true severity-rules regular expressions become case sensitive.
365391 case-sensitive: false
392+
393+ # Default value is empty list.
394+ # When a list of severity rules are provided, severity information will be added to lint
395+ # issues. Severity rules have the same filtering capability as exclude rules except you
396+ # are allowed to specify one matcher per severity rule.
397+ # Only affects out formats that support setting severity information.
398+ rules:
399+ - linters:
400+ - godox
401+ severity: notice