26 Commits

Author SHA1 Message Date
Ludovic Fernandez
64492b5e59
feat: disable copyloopvar and intrange on Go < 1.22 () 2024-02-19 13:58:58 +00:00
dependabot[bot]
ca7b7a42d2
build(deps): bump github.com/mgechev/revive from 1.3.6 to 1.3.7 ()
Co-authored-by: Fernandez Ludovic <ldez@users.noreply.github.com>
2024-02-07 21:30:45 +01:00
Ludovic Fernandez
192ee8929c
go1.22 support () 2024-02-07 15:23:01 +01:00
Ludovic Fernandez
e0a8bd8543
go1.21 support () 2023-08-09 12:09:20 +02:00
Ludovic Fernandez
79c78d6f6f
feat: explain typecheck and remove it from the linter list () 2023-06-29 22:40:59 +02:00
Ludovic Fernandez
12e220b15d
dev: simplify GetAllSupportedLinterConfigs method () 2023-06-13 23:44:28 +02:00
Oleksandr Redko
1e700732e7
dev: gofmt -w -r 'interface{} -> any' pkg scripts () 2023-03-28 16:22:55 +02:00
Ludovic Fernandez
f9d815115c
bump golang.org/x/tools to HEAD ()
* bump golang.org/x/tools to HEAD
* fix: adapt linters to the new validation system.
2022-05-23 12:39:57 +02:00
Ludovic Fernandez
7bbbe77e5e
feat: automatic Go version detection ()
* feat: disable unsupported go1.18 govet analyzers
* fix: inactivate interfacer with go1.18
2022-03-23 16:54:11 +01:00
Ludovic Fernandez
0c0804c6a4
go1.18 support () 2022-03-18 14:58:24 +01:00
Ludovic Fernandez
9aea4aee1c
typecheck: display compilation errors as report instead of error () 2021-03-25 23:52:55 +01:00
Ludovic Fernandez
8db518cee0
Add versions, improve deprecation system, improve linters page () 2021-03-17 16:17:33 +01:00
Ludovic Fernandez
b6a6faa982
Add new presets () 2021-03-16 13:33:28 +01:00
Ludovic Fernandez
87d37c6cf5
Restore fast linters meaning ()
* fix: remove useless conditions.

* feat: considere revive as slow.

* feat: considere linters with go analysis as slow.
2021-03-15 10:13:54 +03:00
Sergey Vilgelm
251b205f54
Deprecate Interfacer linter () 2021-02-20 18:55:11 -06:00
Isaev Denis
279b6d62d3
speed up a bit ()
Ensure that `unused` is always the last
in execution order. It can speed up packages loading
a bit.

Refactor enabled linters set to remove extra logging.

Relates: 
2020-05-05 18:45:19 +03:00
Isaev Denis
95ec0cf21e
dramatically reduce memory usage ()
Run all linters per package. It allows unloading package data when it's
processed. It dramatically reduces memory (and CPU because of GC) usage.

Relates: 
2019-09-30 16:19:41 +03:00
Isaev Denis
6a979fb40d
Update staticcheck and cache go/analysis facts ()
* update staticcheck

Don't fork staticcheck: use the upstream version.
Remove unneeded SSA loading.

* Cache go/analysis facts

Don't load unneeded packages for go/analysis.
Repeated run of go/analysis linters now 10x faster
(2s vs 20s on this repo) than before.
2019-09-17 08:42:16 +03:00
Isaev Denis
c9a9255238
Speed up packages loading ()
Don't perform extra go env calls in go/packages.
Load only needed go env vars in golangci-lint.
Stay in sync by enabled analyzers in go vet: remove nilness and
atomicalign analyzers, add errorsas analyzer.
Don't build SSA for govet.

Standalone govet runs 25% faster than before. All runs can be 5-10% faster
than before.
Relates: 
2019-09-14 18:48:18 +03:00
Denis Isaev
d437ac8629 Implement auto-fixing for gofmt,goimports,misspell
Also, add more identifier marking patterns.
2019-02-17 20:31:31 +03:00
Denis Isaev
7705f82591 Update megacheck to the latest version
Also do following improvements:
  - show proper sublinter name for megacheck sublinters
  - refactor and make more simple and robust megacheck
  merging/optimizing
  - improve handling of unknown linter names in //nolint directives
  - minimize diff of our megacheck version from the upstream,
  https://github.com/golang/go/issues/29612 blocks usage of the upstream
  version
  - support the new `stylecheck` linter
  - improve tests coverage for megacheck and nolint related cases
  - update and use upstream versions of unparam and interfacer instead of forked
  ones
  - don't use golangci/tools repo anymore
  - fix newly found issues after updating linters

Also should be noted that megacheck works much faster and consumes less
memory in the newest release, therefore golangci-lint works noticeably
faster and consumes less memory for large repos.

Relates: 
2019-01-08 21:16:15 +03:00
David López
d9a1bdb831 gocritic: fix code to pass newly added gocritic checks
Fix code to pass newly added gocritic checks, mainly pointer receivers and import shadows
2019-01-08 09:59:24 +03:00
Denis Isaev
0421bac259 Fix , fix : use go/packages
Use go/packages instead of x/tools/loader: it allows to work
with go modules and speedups loading of packages with the help
of build cache.

A lot of linters became "fast": they are enabled by --fast now and
work in 1-2 seconds. Only unparam, interfacer and megacheck
are "slow" linters now.

Average project is analyzed 20-40% faster than before if all linters are
enabled! If we enable all linters except unparam, interfacer and
megacheck analysis is 10-20x faster!
2018-10-28 17:55:15 +03:00
Denis Isaev
8a478c47ac Prepare for : rename GAS to gosec
1. Rename in a backward compatible way
2. Remove gosec default exclude list because gosec is already disabled
by default.
3. Warn about unmatched linter names in //nolint directives
4. Process linter names in //nolint directives in upper case
5. Disable gosec for golangci-lint in .golangci.yml
2018-09-02 09:34:35 +03:00
Denis Isaev
a6b91ccc77 Fix : support unparam linter
1. Support unparam linter and fix found issues
2. Replace forked mvdan.cc/lint and mvdan.cc/interfacer with the
upstream ones
3. Minimize forked megacheck: move the most of it's code to this repo
4. Use golang.org/x/tools/go/ssa import path instead of custom fork
paths
5. In golang.org/x/tools/go/{ssa,callgraph} use changed code from
honnef.co/go/tools
6. Add megacheck.check-unexported option: it found some issues in
the repo, fixed them all
2018-06-30 12:24:07 +03:00
golangci
034728ec94 generate parts of README automatically 2018-06-02 11:37:17 +03:00