From c01d9d760ca6969234f79cb4ab9b6ee4b14e9a0f Mon Sep 17 00:00:00 2001 From: Tam Mach Date: Sun, 18 Oct 2020 17:30:12 +1100 Subject: [PATCH] build(release): Prepare for release 1.32.0 This commit is to prepare for Oct 2020 release. No code changes were done, only run some predefined target: - make update_contributors_list - make assets/github-action-config.json - make expand_website_templates - make update_netlify_state Relates #1456 Signed-off-by: Tam Mach --- README.md | 117 +++-- docs/src/docs/product/roadmap.mdx | 160 +++++- docs/src/docs/usage/configuration.mdx | 695 +++++++++++++++++++++++++- docs/src/docs/usage/install/index.mdx | 14 +- docs/src/docs/usage/linters.mdx | 70 ++- docs/src/docs/usage/quick-start.mdx | 26 +- docs/template_data.state | 2 +- 7 files changed, 1015 insertions(+), 69 deletions(-) mode change 100644 => 100755 docs/src/docs/product/roadmap.mdx mode change 100644 => 100755 docs/src/docs/usage/configuration.mdx mode change 100644 => 100755 docs/src/docs/usage/install/index.mdx mode change 100644 => 100755 docs/src/docs/usage/linters.mdx mode change 100644 => 100755 docs/src/docs/usage/quick-start.mdx diff --git a/README.md b/README.md index 52ac5b002f38..2b682442d5ae 100644 --- a/README.md +++ b/README.md @@ -64,17 +64,17 @@ The Core Team has the following responsibilities: - + - + + - @@ -82,234 +82,247 @@ The Core Team has the following responsibilities: + + - - + - + + - -

Trevor Pounds

Sergey Vilgelm

Tam Mach

Sergey Vilgelm

Simon Sawert

@iwankgb

Xiang Dai

Ryan Currah

Sascha Grunert

Ryan Currah

Duco van Amstel

Pierre Durand

Sascha Grunert

Will Dixon

David Lobe

Denis Tingaikin

Matouš Dzivjak

@nishanths

Alec Thomas

Alexey Palazhchenko

Melvin

Joe Wilner

Soichiro Kashima

Nuruddin Ashr

@nishanths

Nuruddin Ashr

Tim Heckman

Oleg Butuzov

Ryan Boehning

Andrew Shannon Brown

Luke Shumaker

Romanos

Aneesh Agrawal

Aneesh Agrawal

Vladimir Evgrafov

sonata

NiseVoid

James

Sean DuBois

Viktoras

Aliaksandr Mianzhynski

Henrik Johansson
-And 154 more our team members +And 163 more our team members + + + - + + + - - + + + - - - + + + - - + + + - - - + + + + - + + - - - - - + + - - + + - - + + + - - - + + - - + + + - - + + - - - + + + - - + + + + - + - + - + - - + + - + + - + - + - + - + + + +

Aliaksandr Mianzhynski

Henrik Johansson

SystemGlitch

@odidev

Dan Kortschak

John Starich

John Starich

Koichi Shiraishi

Bart

Agniva De Sarker

Ludovic Fernandez

Viacheslav Poturaev

David Braley

Iskander (Alex) Sharipov

Stephan Renatus

Diego Pontoriero

Alex Collins

Ryo Nakao

Tommy Mühle

Sebastiaan van Stijn

@Dominik-K

ferhat elmas

ferhat elmas

M. Ángel Jimeno

Chris Drew

Teiva Harsanyi

Craig Silverstein

Ariel Mashraki

Denis Isaev

Tom Payne

francisco souza

Viacheslav Poturaev

Ryan Olds

Hiroki Suezawa

Fabrice

☃ Elliot Shepherd

Christoph Blecker

gaojingyu

Stephanie Wilde-Hobbs

Cory LaNou

Vitaly Isaev

Shulhan

Vladimir Evgrafov

Renato Suero

Ben Wells

Marat Reymers

Marat Reymers

Jakub Chábek

Christoph Blecker

tdakkota

Eric Wohltman

Gianguido Sora'

Sonia Hamilton

Berezhnoy Pavel

Tom Payne

Aofei Sheng

Maksym Pavlenko

Jonathan Chappelow

Ivan

Dale Hui

Ondrej Fabry

proton

Markus

Andrew Lavery

Kishan B

Tariq Ibrahim

Peter Štibraný

kaixiang zhong

@ced42

David Bariod

Eldar Rakhimberdin

Toon Schoenmakers

Cezar Sá Espinola

Ben Paxton

Andrey Kuchin

Connor Adams

Martins Irbe

Melvin

Joshua Rubin

Kyoichiro Yamada

Rodrigo Brito

Linus Arver

Glen Mailer

Ian Howell

Chris K

Tom Arrell

Marko

Chris Lewis

David Gleich

Muhammad Ikhsan

Denis Titusov

Terdunov Vyacheslav

Sean Chittenden

Hui Zhu

@Harsimran1

@nvartolomei

Martin Etmajer

@techknowlogick

Fei Xu

Matthew Poer

Matthew Poer

Cody Ley-Han

Marc Tudurí

Patrick Zhang

darklore

@to6ka

Daniel Helfand

Wilkins

Collin Kreklow

Grigory Zubankov

Peter Mescalchin

Marcin Owsiany

Henry

David Hill

Troy Ronda

Osamu TONOMORI

Renato Suero

Bo Liu

Steven Allen

Colin Arnott

Eran Levy

Michael

Michael

Evgeniy Kulikov

Chris Nesbitt-Smith

Daniel Caballero

Carlton Henderson

Shintaro Ikeda

@xuri

Charl Matthee

Charl Matthee

Sriram Venkatesh

Peter Schuller

David Golub

Alexander Morozov

Hernan Bandura

Liam White

Alex Dupre

Alex Dupre

Juan Carlos

Juanito

Jinming Yue

Igor Zibarev

@wxdao

Kévin Dunglas

Sijie Yang

Stephen

Stephen

Thang Minh Vu

Julia Ogris

Greg Curtis

Mateusz Bilski

Irina

Dima

Alessio Treglia

Alay Patel

Alay Patel

Martin Hutchinson

Emanuel Bennici

Christian Clauss

Korjavin Ivan

Francois Parquet

Robert Kopaczewski

@opennota

@opennota

Cyrille Meichel

neglect-yp

David Bariod

@jumpeiMano

rinsuki

Wei Jian Gan

Tamás Gulácsi

Jack Wilsdon

Jack Wilsdon

Michał Suchwałko

Alexander Apalikov

Derek Perkins

Domas Tamašauskas

Stéphane Chausson

neo_sli

Ben Ye

@ac-rappi
diff --git a/docs/src/docs/product/roadmap.mdx b/docs/src/docs/product/roadmap.mdx old mode 100644 new mode 100755 index a2ef72b912c2..3d95b07de6d7 --- a/docs/src/docs/product/roadmap.mdx +++ b/docs/src/docs/product/roadmap.mdx @@ -21,11 +21,167 @@ Thanks to [alecthomas/gometalinter](https://github.com/alecthomas/gometalinter) Thanks to [bradleyfalzon/revgrep](https://github.com/bradleyfalzon/revgrep) for cool diff tool. Thanks to developers and authors of used linters: -{.ThanksList} +- [timakin](https://github.com/timakin) +- [sonatard](https://github.com/sonatard) +- [kisielk](https://github.com/kisielk) +- [golang](https://github.com/golang) +- [jingyugao](https://github.com/jingyugao) +- [dominikh](https://github.com/dominikh) +- [securego](https://github.com/securego) +- [opennota](https://github.com/opennota) +- [mvdan](https://github.com/mvdan) +- [mdempsky](https://github.com/mdempsky) +- [gordonklaus](https://github.com/gordonklaus) +- [mibk](https://github.com/mibk) +- [jgautheron](https://github.com/jgautheron) +- [remyoudompheng](https://github.com/remyoudompheng) +- [alecthomas](https://github.com/alecthomas) +- [uudashr](https://github.com/uudashr) +- [tdakkota](https://github.com/tdakkota) +- [denis-tingajkin](https://github.com/denis-tingajkin) +- [daixiang0](https://github.com/daixiang0) +- [OpenPeeDeeP](https://github.com/OpenPeeDeeP) +- [client9](https://github.com/client9) +- [walle](https://github.com/walle) +- [alexkohler](https://github.com/alexkohler) +- [kyoh86](https://github.com/kyoh86) +- [go-critic](https://github.com/go-critic) +- [leighmcculloch](https://github.com/leighmcculloch) +- [matoous](https://github.com/matoous) +- [ultraware](https://github.com/ultraware) +- [bombsimon](https://github.com/bombsimon) +- [jirfag](https://github.com/jirfag) +- [tommy-muehle](https://github.com/tommy-muehle) +- [Djarvur](https://github.com/Djarvur) +- [ryancurrah](https://github.com/ryancurrah) +- [tetafro](https://github.com/tetafro) +- [maratori](https://github.com/maratori) +- [nakabonne](https://github.com/nakabonne) +- [nishanths](https://github.com/nishanths) +- [ryanrolds](https://github.com/ryanrolds) +- [ssgreg](https://github.com/ssgreg) +- [tomarrell](https://github.com/tomarrell) +- [moricho](https://github.com/moricho) +- [mbilski](https://github.com/mbilski) +- [polyfloyd](https://github.com/polyfloyd) +- [golangci](https://github.com/golangci) ## Changelog -{.ChangeLog} +Follow the news and releases on our [twitter](https://twitter.com/golangci) and our [blog](https://medium.com/golangci). +There is the most valuable changes log: + + +### Septempber 2020 + +1. update exhaustive linter (#1339) + + +### August 2020 + +1. new `nlreturn` linter: https://github.com/ssgreg/nlreturn +2. new `gci` linter: https://github.com/daixiang0/gci +3. support `latest` version of golangci-lint in golangci-lint-action +4. update `gosec` linter from 2.3.0 to 2.4.0 +5. update `godot` linter from 0.4.2 to 0.4.8 +6. update `go-critic` from 0.5.0 to 0.5.2 (#1307) +7. update `nlreturn` from 2.0.1 to 2.0.2 (#1287), 2.0.2 to 2.1.0 (#1327) +8. update `gci` to v0.2.1 (#1292), to v0.2.2 (#1305), to v0.2.4 (#1337), +9. update `funlen` from 0.0.2 to 0.0.3 (#1341) +10. upgrade to golang 1.15 for smaller binary (#1303) +11. support short and json formats for version cmd (#1315) +12. add home directory to config file search paths (#1325) +13. allow for serializing multiple golangci-lint invocations (#1302) + + +### July 2020 + +1. `gofumpt` linter: + * update linter + * add `extra-rules` option + * support auto-fixing +2. upgrade `exhaustive` linter +3. upgrade `exportloopref` linter +4. improve 'no such linter' error message +5. sorting result.Issues implementation +6. enhancements in CI: + * Run `nancy` validation for all dependencies + * Move dependabot config to `.github` folder +7. other + * bump `lodash` from 4.17.15 to 4.17.19 in /tools + * bump `golangci/golangci-lint-action` from v1.2.2 to v2 + * bump `github.com/valyala/quicktemplate` from 1.5.0 to 1.5.1 + + +### June 2020 +1. Add new linters: `gofumpt` + +### May 2020 + +1. Add new linters: `nolintlint`, `goerr113` +2. Updated linters: `godot`, `staticcheck` +3. Launch a [website](https://golangci-lint.run) + +### April 2020 + +1. Add new linters: `testpackage`, `nestif`, `godot`, `gomodguard`, `asciicheck` +2. Add github actions output format +3. Update linters: `wsl`, `gomodguard`, `gosec` +4. Support `disabled-tags` setting for `gocritic` +5. Mitigate OOM and "failed prerequisites" +6. Self-isolate due to unexpected pandemics +7. Support case-sensitive excludes +8. Allow granular re-enabling excludes by ID, e.g. `EXC0002` + +### September 2019 + +1. Support go1.13 +2. Add new linters: `funlen`, `whitespace` (with auto-fix) and `godox` +3. Update linters: `gochecknoglobals`, `scopelint`, `gosec` +4. Provide pre-built binary for ARM and FreeBSD +5. 2. Fix false-positives in `unused` +6. Support `--skip-dirs-use-default` +7. Add support for bash completions + +### July 2019 + +1. Fix parallel writes race condition +2. Update bodyclose with fixed panic + +### June 2019 + +1. Treat Go source files as a plain text by `misspell`: it allows detecting issues in strings, variable names, etc. +2. Implement richer and more stable auto-fix of `misspell` issues. + +### May 2019 + +1. Add [bodyclose](https://github.com/timakin/bodyclose) linter. +2. Support junit-xml output. + +### April 2019 + +1. Update go-critic, new checkers were added: badCall, dupImports, evalOrder, newDeref +2. Fix staticcheck panic on packages that do not compile +3. Make install script work on Windows +4. Fix compatibility with the latest x/tools version and update golang.org/x/tools +5. Correct import path of module sourcegraph/go-diff +6. Fix `max-issues-per-linter` name +7. Fix linting of preprocessed files (e.g. `*.qtpl.go`, goyacc) +8. Enable auto-fixing when running via pre-commit + +### March 2019 + +1. Support the newest `go vet` (with `go/analysis`) +2. Support configuration of `go vet`: e.g. you can set print functions by `linters-settings.govet.settings.printf.funcs` +3. Update megacheck (staticcheck) to 2019.1.1 +4. Add [information](https://github.com/golangci/golangci-lint#memory-usage-of-golangci-lint) about controlling space-time trade-off into README +5. Exclude issues by source code line regexp by `issues.exclude-rules[i].source` +6. Build and test on go 1.12 +7. Support `--color` option +8. Update x/tools to fix c++ issues +9. Include support for log level +10. Sort linters list in help commands + ## Future Plans diff --git a/docs/src/docs/usage/configuration.mdx b/docs/src/docs/usage/configuration.mdx old mode 100644 new mode 100755 index 94a9a94ed818..fd93700cf532 --- a/docs/src/docs/usage/configuration.mdx +++ b/docs/src/docs/usage/configuration.mdx @@ -16,7 +16,94 @@ golangci-lint linters ```sh golangci-lint run -h -{.RunHelpText} +Usage: + golangci-lint run [flags] + +Flags: + --out-format string Format of output: colored-line-number|line-number|json|tab|checkstyle|code-climate|junit-xml|github-actions (default "colored-line-number") + --print-issued-lines Print lines of code with issue (default true) + --print-linter-name Print linter name in issue line (default true) + --uniq-by-line Make issues output unique by line (default true) + --sort-results Sort linter results + --path-prefix string Path prefix to add to output + --modules-download-mode string Modules download mode. If not empty, passed as -mod= to go tools + --issues-exit-code int Exit code when issues were found (default 1) + --build-tags strings Build tags + --timeout duration Timeout for total work (default 1m0s) + --tests Analyze tests (*_test.go) (default true) + --print-resources-usage Print avg and max memory usage of golangci-lint and total time + -c, --config PATH Read config from file path PATH + --no-config Don't read config + --skip-dirs strings Regexps of directories to skip + --skip-dirs-use-default Use or not use default excluded directories: + - (^|/)vendor($|/) + - (^|/)third_party($|/) + - (^|/)testdata($|/) + - (^|/)examples($|/) + - (^|/)Godeps($|/) + - (^|/)builtin($|/) + (default true) + --skip-files strings Regexps of files to skip + --allow-parallel-runners Allow multiple parallel golangci-lint instances running. If false (default) - golangci-lint acquires file lock on start. + --allow-serial-runners Allow multiple golangci-lint instances running, but serialize them around a lock. If false (default) - golangci-lint exits with an error if it fails to acquire file lock on start. + -E, --enable strings Enable specific linter + -D, --disable strings Disable specific linter + --disable-all Disable all linters + -p, --presets strings Enable presets (bugs|complexity|format|performance|style|unused) of linters. Run 'golangci-lint linters' to see them. This option implies option --disable-all + --fast Run only fast linters from enabled linters set (first run won't be fast) + -e, --exclude strings Exclude issue by regexp + --exclude-use-default Use or not use default excludes: + # EXC0001 errcheck: Almost all programs ignore errors on these functions and in most cases it's ok + - Error return value of .((os\.)?std(out|err)\..*|.*Close|.*Flush|os\.Remove(All)?|.*print(f|ln)?|os\.(Un)?Setenv). is not checked + + # EXC0002 golint: Annoying issue about not having a comment. The rare codebase has such comments + - (comment on exported (method|function|type|const)|should have( a package)? comment|comment should be of the form) + + # EXC0003 golint: False positive when tests are defined in package 'test' + - func name will be used as test\.Test.* by other packages, and that stutters; consider calling this + + # EXC0004 govet: Common false positives + - (possible misuse of unsafe.Pointer|should have signature) + + # EXC0005 staticcheck: Developers tend to write in C-style with an explicit 'break' in a 'switch', so it's ok to ignore + - ineffective break statement. Did you mean to break out of the outer loop + + # EXC0006 gosec: Too many false-positives on 'unsafe' usage + - Use of unsafe calls should be audited + + # EXC0007 gosec: Too many false-positives for parametrized shell calls + - Subprocess launch(ed with variable|ing should be audited) + + # EXC0008 gosec: Duplicated errcheck checks + - (G104|G307) + + # EXC0009 gosec: Too many issues in popular repos + - (Expect directory permissions to be 0750 or less|Expect file permissions to be 0600 or less) + + # EXC0010 gosec: False positive is triggered by 'src, err := ioutil.ReadFile(filename)' + - Potential file inclusion via variable + (default true) + --exclude-case-sensitive If set to true exclude and exclude rules regular expressions are case sensitive + --max-issues-per-linter int Maximum issues count per one linter. Set to 0 to disable (default 50) + --max-same-issues int Maximum count of issues with the same text. Set to 0 to disable (default 3) + -n, --new Show only new issues: if there are unstaged changes or untracked files, only those changes are analyzed, else only changes in HEAD~ are analyzed. + It's a super-useful option for integration of golangci-lint into existing large codebase. + It's not practical to fix all existing issues at the moment of integration: much better to not allow issues in new code. + For CI setups, prefer --new-from-rev=HEAD~, as --new can skip linting the current patch if any scripts generate unstaged files before golangci-lint runs. + --new-from-rev REV Show only new issues created after git revision REV + --new-from-patch PATH Show only new issues created in git patch with file path PATH + --fix Fix found issues (if it's supported by the linter) + -h, --help help for run + +Global Flags: + --color string Use color when printing; can be 'always', 'auto', or 'never' (default "auto") + -j, --concurrency int Concurrency (default NumCPU) (default 8) + --cpu-profile-path string Path to CPU profile output file + --mem-profile-path string Path to memory profile output file + --trace-path string Path to trace output file + -v, --verbose verbose output + --version Print version + ``` ## Config File @@ -39,12 +126,614 @@ There is a [`.golangci.example.yml`](https://github.com/golangci/golangci-lint/b config file with all supported options, their description and default value: ```yaml -{ .GolangciYamlExample } +# This file contains all available configuration options +# with their default values. + +# options for analysis running +run: + # default concurrency is a available CPU number + concurrency: 4 + + # timeout for analysis, e.g. 30s, 5m, default is 1m + timeout: 1m + + # exit code when at least one issue was found, default is 1 + issues-exit-code: 1 + + # include test files or not, default is true + tests: true + + # list of build tags, all linters use it. Default is empty list. + build-tags: + - mytag + + # which dirs to skip: issues from them won't be reported; + # can use regexp here: generated.*, regexp is applied on full path; + # default value is empty list, but default dirs are skipped independently + # from this option's value (see skip-dirs-use-default). + # "/" will be replaced by current OS file path separator to properly work + # on Windows. + skip-dirs: + - src/external_libs + - autogenerated_by_my_lib + + # default is true. Enables skipping of directories: + # vendor$, third_party$, testdata$, examples$, Godeps$, builtin$ + skip-dirs-use-default: true + + # which files to skip: they will be analyzed, but issues from them + # won't be reported. Default value is empty list, but there is + # no need to include all autogenerated files, we confidently recognize + # autogenerated files. If it's not please let us know. + # "/" will be replaced by current OS file path separator to properly work + # on Windows. + skip-files: + - ".*\\.my\\.go$" + - lib/bad.go + + # by default isn't set. If set we pass it to "go list -mod={option}". From "go help modules": + # If invoked with -mod=readonly, the go command is disallowed from the implicit + # automatic updating of go.mod described above. Instead, it fails when any changes + # to go.mod are needed. This setting is most useful to check that go.mod does + # not need updates, such as in a continuous integration and testing system. + # If invoked with -mod=vendor, the go command assumes that the vendor + # directory holds the correct copies of dependencies and ignores + # the dependency descriptions in go.mod. + modules-download-mode: readonly|release|vendor + + # Allow multiple parallel golangci-lint instances running. + # If false (default) - golangci-lint acquires file lock on start. + allow-parallel-runners: false + + +# output configuration options +output: + # colored-line-number|line-number|json|tab|checkstyle|code-climate, default is "colored-line-number" + format: colored-line-number + + # print lines of code with issue, default is true + print-issued-lines: true + + # print linter name in the end of issue text, default is true + print-linter-name: true + + # make issues output unique by line, default is true + uniq-by-line: true + + # add a prefix to the output file references; default is no prefix + path-prefix: "" + + +# all available settings of specific linters +linters-settings: + dogsled: + # checks assignments with too many blank identifiers; default is 2 + max-blank-identifiers: 2 + dupl: + # tokens count to trigger issue, 150 by default + threshold: 100 + errcheck: + # report about not checking of errors in type assertions: `a := b.(MyStruct)`; + # default is false: such cases aren't reported by default. + check-type-assertions: false + + # report about assignment of errors to blank identifier: `num, _ := strconv.Atoi(numStr)`; + # default is false: such cases aren't reported by default. + check-blank: false + + # [deprecated] comma-separated list of pairs of the form pkg:regex + # the regex is used to ignore names within pkg. (default "fmt:.*"). + # see https://github.com/kisielk/errcheck#the-deprecated-method for details + ignore: fmt:.*,io/ioutil:^Read.* + + # path to a file containing a list of functions to exclude from checking + # see https://github.com/kisielk/errcheck#excluding-functions for details + exclude: /path/to/file.txt + exhaustive: + # check switch statements in generated files also + check-generated: false + # indicates that switch statements are to be considered exhaustive if a + # 'default' case is present, even if all enum members aren't listed in the + # switch + default-signifies-exhaustive: false + funlen: + lines: 60 + statements: 40 + gci: + # put imports beginning with prefix after 3rd-party packages; + # only support one prefix + # if not set, use goimports.local-prefixes + local-prefixes: github.com/org/project + gocognit: + # minimal code complexity to report, 30 by default (but we recommend 10-20) + min-complexity: 10 + nestif: + # minimal complexity of if statements to report, 5 by default + min-complexity: 4 + goconst: + # minimal length of string constant, 3 by default + min-len: 3 + # minimal occurrences count to trigger, 3 by default + min-occurrences: 3 + gocritic: + # Which checks should be enabled; can't be combined with 'disabled-checks'; + # See https://go-critic.github.io/overview#checks-overview + # To check which checks are enabled run `GL_DEBUG=gocritic golangci-lint run` + # By default list of stable checks is used. + enabled-checks: + - rangeValCopy + + # Which checks should be disabled; can't be combined with 'enabled-checks'; default is empty + disabled-checks: + - regexpMust + + # Enable multiple checks by tags, run `GL_DEBUG=gocritic golangci-lint run` to see all tags and checks. + # Empty list by default. See https://github.com/go-critic/go-critic#usage -> section "Tags". + enabled-tags: + - performance + disabled-tags: + - experimental + + settings: # settings passed to gocritic + captLocal: # must be valid enabled check name + paramsOnly: true + rangeValCopy: + sizeThreshold: 32 + gocyclo: + # minimal code complexity to report, 30 by default (but we recommend 10-20) + min-complexity: 10 + godot: + # check all top-level comments, not only declarations + check-all: false + godox: + # report any comments starting with keywords, this is useful for TODO or FIXME comments that + # might be left in the code accidentally and should be resolved before merging + keywords: # default keywords are TODO, BUG, and FIXME, these can be overwritten by this setting + - NOTE + - OPTIMIZE # marks code that should be optimized before merging + - HACK # marks hack-arounds that should be removed before merging + gofmt: + # simplify code: gofmt with `-s` option, true by default + simplify: true + goheader: + values: + const: + # define here const type values in format k:v, for example: + # YEAR: 2020 + # COMPANY: MY COMPANY + regexp: + # define here regexp type values, for example + # AUTHOR: .*@mycompany\.com + template: + # put here copyright header template for source code files, for example: + # {{ AUTHOR }} {{ COMPANY }} {{ YEAR }} + # SPDX-License-Identifier: Apache-2.0 + # + # Licensed under the Apache License, Version 2.0 (the "License"); + # you may not use this file except in compliance with the License. + # You may obtain a copy of the License at: + # + # http://www.apache.org/licenses/LICENSE-2.0 + # + # Unless required by applicable law or agreed to in writing, software + # distributed under the License is distributed on an "AS IS" BASIS, + # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + # See the License for the specific language governing permissions and + # limitations under the License. + template-path: + # also as alternative of directive 'template' you may put the path to file with the template source + goimports: + # put imports beginning with prefix after 3rd-party packages; + # it's a comma-separated list of prefixes + local-prefixes: github.com/org/project + golint: + # minimal confidence for issues, default is 0.8 + min-confidence: 0.8 + gomnd: + settings: + mnd: + # the list of enabled checks, see https://github.com/tommy-muehle/go-mnd/#checks for description. + checks: argument,case,condition,operation,return,assign + gomodguard: + allowed: + modules: # List of allowed modules + # - gopkg.in/yaml.v2 + domains: # List of allowed module domains + # - golang.org + blocked: + modules: # List of blocked modules + # - github.com/uudashr/go-module: # Blocked module + # recommendations: # Recommended modules that should be used instead (Optional) + # - golang.org/x/mod + # reason: "`mod` is the official go.mod parser library." # Reason why the recommended module should be used (Optional) + versions: # List of blocked module version constraints + # - github.com/mitchellh/go-homedir: # Blocked module with version constraint + # version: "< 1.1.0" # Version constraint, see https://github.com/Masterminds/semver#basic-comparisons + # reason: "testing if blocked version constraint works." # Reason why the version constraint exists. (Optional) + govet: + # report about shadowed variables + check-shadowing: true + + # settings per analyzer + settings: + printf: # analyzer name, run `go tool vet help` to see all analyzers + funcs: # run `go tool vet help printf` to see available settings for `printf` analyzer + - (github.com/golangci/golangci-lint/pkg/logutils.Log).Infof + - (github.com/golangci/golangci-lint/pkg/logutils.Log).Warnf + - (github.com/golangci/golangci-lint/pkg/logutils.Log).Errorf + - (github.com/golangci/golangci-lint/pkg/logutils.Log).Fatalf + + # enable or disable analyzers by name + enable: + - atomicalign + enable-all: false + disable: + - shadow + disable-all: false + depguard: + list-type: blacklist + include-go-root: false + packages: + - github.com/sirupsen/logrus + packages-with-error-message: + # specify an error message to output when a blacklisted package is used + - github.com/sirupsen/logrus: "logging is allowed only by logutils.Log" + lll: + # max line length, lines longer will be reported. Default is 120. + # '\t' is counted as 1 character by default, and can be changed with the tab-width option + line-length: 120 + # tab width in spaces. Default to 1. + tab-width: 1 + maligned: + # print struct with more effective memory layout or not, false by default + suggest-new: true + misspell: + # Correct spellings using locale preferences for US or UK. + # Default is to use a neutral variety of English. + # Setting locale to US will correct the British spelling of 'colour' to 'color'. + locale: US + ignore-words: + - someword + nakedret: + # make an issue if func has more lines of code than this setting and it has naked returns; default is 30 + max-func-lines: 30 + prealloc: + # XXX: we don't recommend using this linter before doing performance profiling. + # For most programs usage of prealloc will be a premature optimization. + + # Report preallocation suggestions only on simple loops that have no returns/breaks/continues/gotos in them. + # True by default. + simple: true + range-loops: true # Report preallocation suggestions on range loops, true by default + for-loops: false # Report preallocation suggestions on for loops, false by default + nolintlint: + # Enable to ensure that nolint directives are all used. Default is true. + allow-unused: false + # Disable to ensure that nolint directives don't have a leading space. Default is true. + allow-leading-space: true + # Exclude following linters from requiring an explanation. Default is []. + allow-no-explanation: [] + # Enable to require an explanation of nonzero length after each nolint directive. Default is false. + require-explanation: true + # Enable to require nolint directives to mention the specific linter being suppressed. Default is false. + require-specific: true + rowserrcheck: + packages: + - github.com/jmoiron/sqlx + testpackage: + # regexp pattern to skip files + skip-regexp: (export|internal)_test\.go + unparam: + # Inspect exported functions, default is false. Set to true if no external program/library imports your code. + # XXX: if you enable this setting, unparam will report a lot of false-positives in text editors: + # if it's called for subdir of a project it can't find external interfaces. All text editor integrations + # with golangci-lint call it on a directory with the changed file. + check-exported: false + unused: + # treat code as a program (not a library) and report unused exported identifiers; default is false. + # XXX: if you enable this setting, unused will report a lot of false-positives in text editors: + # if it's called for subdir of a project it can't find funcs usages. All text editor integrations + # with golangci-lint call it on a directory with the changed file. + check-exported: false + whitespace: + multi-if: false # Enforces newlines (or comments) after every multi-line if statement + multi-func: false # Enforces newlines (or comments) after every multi-line function signature + wsl: + # If true append is only allowed to be cuddled if appending value is + # matching variables, fields or types on line above. Default is true. + strict-append: true + # Allow calls and assignments to be cuddled as long as the lines have any + # matching variables, fields or types. Default is true. + allow-assign-and-call: true + # Allow multiline assignments to be cuddled. Default is true. + allow-multiline-assign: true + # Allow declarations (var) to be cuddled. + allow-cuddle-declarations: false + # Allow trailing comments in ending of blocks + allow-trailing-comment: false + # Force newlines in end of case at this limit (0 = never). + force-case-trailing-whitespace: 0 + # Force cuddling of err checks with err var assignment + force-err-cuddling: false + # Allow leading comments to be separated with empty liens + allow-separated-leading-comment: false + gofumpt: + # Choose whether or not to use the extra rules that are disabled + # by default + extra-rules: false + errorlint: + # Report non-wrapping error creation using fmt.Errorf + errorf: true + + # The custom section can be used to define linter plugins to be loaded at runtime. See README doc + # for more info. + custom: + # Each custom linter should have a unique name. + example: + # The path to the plugin *.so. Can be absolute or local. Required for each custom linter + path: /path/to/example.so + # The description of the linter. Optional, just for documentation purposes. + description: This is an example usage of a plugin linter. + # Intended to point to the repo location of the linter. Optional, just for documentation purposes. + original-url: github.com/golangci/example-linter + +linters: + enable: + - megacheck + - govet + disable: + - maligned + - prealloc + disable-all: false + presets: + - bugs + - unused + fast: false + + +issues: + # List of regexps of issue texts to exclude, empty list by default. + # But independently from this option we use default exclude patterns, + # it can be disabled by `exclude-use-default: false`. To list all + # excluded by default patterns execute `golangci-lint run --help` + exclude: + - abcdef + + # Excluding configuration per-path, per-linter, per-text and per-source + exclude-rules: + # Exclude some linters from running on tests files. + - path: _test\.go + linters: + - gocyclo + - errcheck + - dupl + - gosec + + # Exclude known linters from partially hard-vendored code, + # which is impossible to exclude via "nolint" comments. + - path: internal/hmac/ + text: "weak cryptographic primitive" + linters: + - gosec + + # Exclude some staticcheck messages + - linters: + - staticcheck + text: "SA9003:" + + # Exclude lll issues for long lines with go:generate + - linters: + - lll + source: "^//go:generate " + + # Independently from option `exclude` we use default exclude patterns, + # it can be disabled by this option. To list all + # excluded by default patterns execute `golangci-lint run --help`. + # Default value for this option is true. + exclude-use-default: false + + # The default value is false. If set to true exclude and exclude-rules + # regular expressions become case sensitive. + exclude-case-sensitive: false + + # The list of ids of default excludes to include or disable. By default it's empty. + include: + - EXC0002 # disable excluding of issues about comments from golint + + # Maximum issues count per one linter. Set to 0 to disable. Default is 50. + max-issues-per-linter: 0 + + # Maximum count of issues with the same text. Set to 0 to disable. Default is 3. + max-same-issues: 0 + + # Show only new issues: if there are unstaged changes or untracked files, + # only those changes are analyzed, else only changes in HEAD~ are analyzed. + # It's a super-useful option for integration of golangci-lint into existing + # large codebase. It's not practical to fix all existing issues at the moment + # of integration: much better don't allow issues in new code. + # Default is false. + new: false + + # Show only new issues created after git revision `REV` + new-from-rev: REV + + # Show only new issues created in git patch with set file path. + new-from-patch: path/to/patch/file + +severity: + # Default value is empty string. + # Set the default severity for issues. If severity rules are defined and the issues + # do not match or no severity is provided to the rule this will be the default + # severity applied. Severities should match the supported severity names of the + # selected out format. + # - Code climate: https://docs.codeclimate.com/docs/issues#issue-severity + # - Checkstyle: https://checkstyle.sourceforge.io/property_types.html#severity + # - Github: https://help.github.com/en/actions/reference/workflow-commands-for-github-actions#setting-an-error-message + default-severity: error + + # The default value is false. + # If set to true severity-rules regular expressions become case sensitive. + case-sensitive: false + + # Default value is empty list. + # When a list of severity rules are provided, severity information will be added to lint + # issues. Severity rules have the same filtering capability as exclude rules except you + # are allowed to specify one matcher per severity rule. + # Only affects out formats that support setting severity information. + rules: + - linters: + - dupl + severity: info ``` It's a [.golangci.yml](https://github.com/golangci/golangci-lint/blob/master/.golangci.yml) config file of this repo: we enable more linters than the default and have more strict settings: ```yaml -{ .GolangciYaml } +linters-settings: + depguard: + list-type: blacklist + packages: + # logging is allowed only by logutils.Log, logrus + # is allowed to use only in logutils package + - github.com/sirupsen/logrus + packages-with-error-message: + - github.com/sirupsen/logrus: "logging is allowed only by logutils.Log" + dupl: + threshold: 100 + funlen: + lines: 100 + statements: 50 + gci: + local-prefixes: github.com/golangci/golangci-lint + goconst: + min-len: 2 + min-occurrences: 2 + gocritic: + enabled-tags: + - diagnostic + - experimental + - opinionated + - performance + - style + disabled-checks: + - dupImport # https://github.com/go-critic/go-critic/issues/845 + - ifElseChain + - octalLiteral + - whyNoLint + - wrapperFunc + gocyclo: + min-complexity: 15 + goimports: + local-prefixes: github.com/golangci/golangci-lint + golint: + min-confidence: 0 + gomnd: + settings: + mnd: + # don't include the "operation" and "assign" + checks: argument,case,condition,return + govet: + check-shadowing: true + settings: + printf: + funcs: + - (github.com/golangci/golangci-lint/pkg/logutils.Log).Infof + - (github.com/golangci/golangci-lint/pkg/logutils.Log).Warnf + - (github.com/golangci/golangci-lint/pkg/logutils.Log).Errorf + - (github.com/golangci/golangci-lint/pkg/logutils.Log).Fatalf + lll: + line-length: 140 + maligned: + suggest-new: true + misspell: + locale: US + nolintlint: + allow-leading-space: true # don't require machine-readable nolint directives (i.e. with no leading space) + allow-unused: false # report any unused nolint directives + require-explanation: false # don't require an explanation for nolint directives + require-specific: false # don't require nolint directives to be specific about which linter is being skipped + +linters: + # please, do not use `enable-all`: it's deprecated and will be removed soon. + # inverted configuration with `enable-all` and `disable` is not scalable during updates of golangci-lint + disable-all: true + enable: + - bodyclose + - deadcode + - depguard + - dogsled + - dupl + - errcheck + - exhaustive + - funlen + - gochecknoinits + - goconst + - gocritic + - gocyclo + - gofmt + - goimports + - golint + - gomnd + - goprintffuncname + - gosec + - gosimple + - govet + - ineffassign + - interfacer + - lll + - misspell + - nakedret + - noctx + - nolintlint + - rowserrcheck + - scopelint + - staticcheck + - structcheck + - stylecheck + - typecheck + - unconvert + - unparam + - unused + - varcheck + - whitespace + + # don't enable: + # - asciicheck + # - gochecknoglobals + # - gocognit + # - godot + # - godox + # - goerr113 + # - maligned + # - nestif + # - prealloc + # - testpackage + # - wsl + +issues: + # Excluding configuration per-path, per-linter, per-text and per-source + exclude-rules: + - path: _test\.go + linters: + - gomnd + + # https://github.com/go-critic/go-critic/issues/926 + - linters: + - gocritic + text: "unnecessaryDefer:" + +run: + skip-dirs: + - test/testdata_etc + - internal/cache + - internal/renameio + - internal/robustio + +# golangci.com configuration +# https://github.com/golangci/golangci/wiki/Configuration +service: + golangci-lint-version: 1.23.x # use the fixed version to not introduce new linters unexpectedly + prepare: + - echo "here I can run custom commands, but no preparation needed for this repo" ``` diff --git a/docs/src/docs/usage/install/index.mdx b/docs/src/docs/usage/install/index.mdx old mode 100644 new mode 100755 index 53b4457ad8cc..22560e7829b7 --- a/docs/src/docs/usage/install/index.mdx +++ b/docs/src/docs/usage/install/index.mdx @@ -24,17 +24,17 @@ use deprecated option `--enable-all` and a new linter is added or even without ` It's highly recommended to install a specific version of golangci-lint available on the [releases page](https://github.com/golangci/golangci-lint/releases). -Here is the recommended way to install golangci-lint {.LatestVersion}: +Here is the recommended way to install golangci-lint v1.31.0: ```sh # binary will be $(go env GOPATH)/bin/golangci-lint -curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s -- -b $(go env GOPATH)/bin {.LatestVersion} +curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s -- -b $(go env GOPATH)/bin v1.31.0 # or install it into ./bin/ -curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s {.LatestVersion} +curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s v1.31.0 # In alpine linux (as it does not come with curl by default) -wget -O- -nv https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s {.LatestVersion} +wget -O- -nv https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s v1.31.0 golangci-lint --version ``` @@ -63,14 +63,14 @@ sudo port install golangci-lint ### Docker ```sh -docker run --rm -v $(pwd):/app -w /app golangci/golangci-lint:{.LatestVersion} golangci-lint run -v +docker run --rm -v $(pwd):/app -w /app golangci/golangci-lint:v1.31.0 golangci-lint run -v ``` ### Linux and Windows ```sh # binary will be $(go env GOPATH)/bin/golangci-lint -curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s -- -b $(go env GOPATH)/bin {.LatestVersion} +curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s -- -b $(go env GOPATH)/bin v1.31.0 golangci-lint --version ``` @@ -97,7 +97,7 @@ Note: such `go get` installation aren't guaranteed to work. We recommend using b
```sh -go get github.com/golangci/golangci-lint/cmd/golangci-lint@{.LatestVersion} +go get github.com/golangci/golangci-lint/cmd/golangci-lint@v1.31.0 ```
diff --git a/docs/src/docs/usage/linters.mdx b/docs/src/docs/usage/linters.mdx old mode 100644 new mode 100755 index 5908347b9f22..50d43ea0551e --- a/docs/src/docs/usage/linters.mdx +++ b/docs/src/docs/usage/linters.mdx @@ -10,8 +10,74 @@ golangci-lint help linters ## Enabled By Default Linters -{.EnabledByDefaultLinters} +- [deadcode](https://github.com/remyoudompheng/go-misc/tree/master/deadcode) - Finds unused code +- [errcheck](https://github.com/kisielk/errcheck) - Errcheck is a program for checking for unchecked errors in go programs. These unchecked errors can be critical bugs in some cases +- [gosimple](https://github.com/dominikh/go-tools/tree/master/simple) - Linter for Go source code that specializes in simplifying a code +- [govet](https://golang.org/cmd/vet/) - Vet examines Go source code and reports suspicious constructs, such as Printf calls whose arguments do not align with the format string +- [ineffassign](https://github.com/gordonklaus/ineffassign) - Detects when assignments to existing variables are not used +- [staticcheck](https://staticcheck.io/) - Staticcheck is a go vet on steroids, applying a ton of static analysis checks +- [structcheck](https://github.com/opennota/check) - Finds unused struct fields +- typecheck - Like the front-end of a Go compiler, parses and type-checks Go code +- [unused](https://github.com/dominikh/go-tools/tree/master/unused) - Checks Go code for unused constants, variables, functions and types +- [varcheck](https://github.com/opennota/check) - Finds unused global variables and constants ## Disabled By Default Linters (`-E/--enable`) -{.DisabledByDefaultLinters} +- [asciicheck](https://github.com/tdakkota/asciicheck) - Simple linter to check that your code does not contain non-ASCII identifiers +- [bodyclose](https://github.com/timakin/bodyclose) - checks whether HTTP response body is closed successfully +- [depguard](https://github.com/OpenPeeDeeP/depguard) - Go linter that checks if package imports are in a list of acceptable packages +- [dogsled](https://github.com/alexkohler/dogsled) - Checks assignments with too many blank identifiers (e.g. x, _, _, _, := f()) +- [dupl](https://github.com/mibk/dupl) - Tool for code clone detection +- [errorlint](https://github.com/polyfloyd/go-errorlint) - go-errorlint is a source code linter for Go software that can be used to find code that will cause problemswith the error wrapping scheme introduced in Go 1.13. +- [exhaustive](https://github.com/nishanths/exhaustive) - check exhaustiveness of enum switch statements +- [exhaustivestruct](https://github.com/mbilski/exhaustivestruct) - Checks if all struct's fields are initialized +- [exportloopref](https://github.com/kyoh86/exportloopref) - checks for pointers to enclosing loop variables +- [funlen](https://github.com/ultraware/funlen) - Tool for detection of long functions +- [gci](https://github.com/daixiang0/gci) - Gci control golang package import order and make it always deterministic. +- [gochecknoglobals](https://github.com/leighmcculloch/gochecknoglobals) - check that no global variables exist + +This analyzer checks for global variables and errors on any found. + +A global variable is a variable declared in package scope and that can be read +and written to by any function within the package. Global variables can cause +side effects which are difficult to keep track of. A code in one function may +change the variables state while another unrelated chunk of code may be +effected by it. +- [gochecknoinits](https://github.com/leighmcculloch/gochecknoinits) - Checks that no init functions are present in Go code +- [gocognit](https://github.com/uudashr/gocognit) - Computes and checks the cognitive complexity of functions +- [goconst](https://github.com/jgautheron/goconst) - Finds repeated strings that could be replaced by a constant +- [gocritic](https://github.com/go-critic/go-critic) - The most opinionated Go source code linter +- [gocyclo](https://github.com/alecthomas/gocyclo) - Computes and checks the cyclomatic complexity of functions +- [godot](https://github.com/tetafro/godot) - Check if comments end in a period +- [godox](https://github.com/matoous/godox) - Tool for detection of FIXME, TODO and other comment keywords +- [goerr113](https://github.com/Djarvur/go-err113) - Golang linter to check the errors handling expressions +- [gofmt](https://golang.org/cmd/gofmt/) - Gofmt checks whether code was gofmt-ed. By default this tool runs with -s option to check for code simplification +- [gofumpt](https://github.com/mvdan/gofumpt) - Gofumpt checks whether code was gofumpt-ed. +- [goheader](https://github.com/denis-tingajkin/go-header) - Checks is file header matches to pattern +- [goimports](https://godoc.org/golang.org/x/tools/cmd/goimports) - Goimports does everything that gofmt does. Additionally it checks unused imports +- [golint](https://github.com/golang/lint) - Golint differs from gofmt. Gofmt reformats Go source code, whereas golint prints out style mistakes +- [gomnd](https://github.com/tommy-muehle/go-mnd) - An analyzer to detect magic numbers. +- [gomodguard](https://github.com/ryancurrah/gomodguard) - Allow and block list linter for direct Go module dependencies. This is different from depguard where there are different block types for example version constraints and module recommendations. +- [goprintffuncname](https://github.com/jirfag/go-printf-func-name) - Checks that printf-like functions are named with `f` at the end +- [gosec](https://github.com/securego/gosec) - Inspects source code for security problems +- [interfacer](https://github.com/mvdan/interfacer) - Linter that suggests narrower interface types +- [lll](https://github.com/walle/lll) - Reports long lines +- [maligned](https://github.com/mdempsky/maligned) - Tool to detect Go structs that would take less memory if their fields were sorted +- [misspell](https://github.com/client9/misspell) - Finds commonly misspelled English words in comments +- [nakedret](https://github.com/alexkohler/nakedret) - Finds naked returns in functions greater than a specified function length +- [nestif](https://github.com/nakabonne/nestif) - Reports deeply nested if statements +- [nlreturn](https://github.com/ssgreg/nlreturn) - nlreturn checks for a new line before return and branch statements to increase code clarity +- [noctx](https://github.com/sonatard/noctx) - noctx finds sending http request without context.Context +- [nolintlint](https://github.com/golangci/golangci-lint/blob/master/pkg/golinters/nolintlint/README.md) - Reports ill-formed or insufficient nolint directives +- [prealloc](https://github.com/alexkohler/prealloc) - Finds slice declarations that could potentially be preallocated +- [rowserrcheck](https://github.com/jingyugao/rowserrcheck) - checks whether Err of rows is checked successfully +- [scopelint](https://github.com/kyoh86/scopelint) - Scopelint checks for unpinned variables in go programs +- [sqlclosecheck](https://github.com/ryanrolds/sqlclosecheck) - Checks that sql.Rows and sql.Stmt are closed. +- [stylecheck](https://github.com/dominikh/go-tools/tree/master/stylecheck) - Stylecheck is a replacement for golint +- [testpackage](https://github.com/maratori/testpackage) - linter that makes you use a separate _test package +- [tparallel](https://github.com/moricho/tparallel) - tparallel detects inappropriate usage of t.Parallel() method in your Go test codes +- [unconvert](https://github.com/mdempsky/unconvert) - Remove unnecessary type conversions +- [unparam](https://github.com/mvdan/unparam) - Reports unused function parameters +- [whitespace](https://github.com/ultraware/whitespace) - Tool for detection of leading and trailing whitespace +- [wrapcheck](https://github.com/tomarrell/wrapcheck) - Checks that errors returned from external packages are wrapped +- [wsl](https://github.com/bombsimon/wsl) - Whitespace Linter - Forces you to use empty lines! diff --git a/docs/src/docs/usage/quick-start.mdx b/docs/src/docs/usage/quick-start.mdx old mode 100644 new mode 100755 index 2894998c0fc8..25abe598a24e --- a/docs/src/docs/usage/quick-start.mdx +++ b/docs/src/docs/usage/quick-start.mdx @@ -26,7 +26,17 @@ GolangCI-Lint can be used with zero configuration. By default the following lint ```sh $ golangci-lint help linters -{.LintersCommandOutputEnabledOnly} +Enabled by default linters: +deadcode: Finds unused code [fast: true, auto-fix: false] +errcheck: Errcheck is a program for checking for unchecked errors in go programs. These unchecked errors can be critical bugs in some cases [fast: true, auto-fix: false] +gosimple (megacheck): Linter for Go source code that specializes in simplifying a code [fast: true, auto-fix: false] +govet (vet, vetshadow): Vet examines Go source code and reports suspicious constructs, such as Printf calls whose arguments do not align with the format string [fast: true, auto-fix: false] +ineffassign: Detects when assignments to existing variables are not used [fast: true, auto-fix: false] +staticcheck (megacheck): Staticcheck is a go vet on steroids, applying a ton of static analysis checks [fast: true, auto-fix: false] +structcheck: Finds unused struct fields [fast: true, auto-fix: false] +typecheck: Like the front-end of a Go compiler, parses and type-checks Go code [fast: true, auto-fix: false] +unused (megacheck): Checks Go code for unused constants, variables, functions and types [fast: false, auto-fix: false] +varcheck: Finds unused global variables and constants [fast: true, auto-fix: false] ``` and the following linters are disabled by default: @@ -34,7 +44,19 @@ and the following linters are disabled by default: ```sh $ golangci-lint help linters ... -{.LintersCommandOutputDisabledOnly} +Disabled by default linters: +asciicheck: Simple linter to check that your code does not contain non-ASCII identifiers [fast: true, auto-fix: false] +bodyclose: checks whether HTTP response body is closed successfully [fast: true, auto-fix: false] +depguard: Go linter that checks if package imports are in a list of acceptable packages [fast: true, auto-fix: false] +dogsled: Checks assignments with too many blank identifiers (e.g. x, _, _, _, := f()) [fast: true, auto-fix: false] +dupl: Tool for code clone detection [fast: true, auto-fix: false] +errorlint: go-errorlint is a source code linter for Go software that can be used to find code that will cause problemswith the error wrapping scheme introduced in Go 1.13. [fast: true, auto-fix: false] +exhaustive: check exhaustiveness of enum switch statements [fast: true, auto-fix: false] +exhaustivestruct: Checks if all struct's fields are initialized [fast: true, auto-fix: false] +exportloopref: checks for pointers to enclosing loop variables [fast: true, auto-fix: false] +funlen: Tool for detection of long functions [fast: true, auto-fix: false] +gci: Gci control golang package import order and make it always deterministic. [fast: true, auto-fix: true] +gochecknoglobals: check that no global variables exist ``` Pass `-E/--enable` to enable linter and `-D/--disable` to disable: diff --git a/docs/template_data.state b/docs/template_data.state index fff9a99ac6f1..06ee8f2e7404 100755 --- a/docs/template_data.state +++ b/docs/template_data.state @@ -1,2 +1,2 @@ This file stores hash of website templates to trigger Netlify rebuild when something changes, e.g. new linter is added. -a0a70d27d9ada08bddf6aa33346b3b265a9cbebe8a358e94083c36654a8ec479 \ No newline at end of file +1bfe6c52f1d4be2bd91b2b278231dcf3929d64d9722d99d9357296c25d419525 \ No newline at end of file