11 Commits

Author SHA1 Message Date
Oleksandr Redko
1e700732e7
dev: gofmt -w -r 'interface{} -> any' pkg scripts () 2023-03-28 16:22:55 +02:00
Oleksandr Redko
b673c5c1af
dev: replace pkg/errors with native error wrapping ()
Co-authored-by: Fernandez Ludovic <ldez@users.noreply.github.com>
2023-02-22 01:35:43 +01:00
Sebastien Rosset
d0b2463fd7
doc: improve documentation for goimport local-prefixes () 2022-12-13 11:20:39 +01:00
Ludovic Fernandez
aba80c7fe2
feat: update gofmt and goimports and add option "rewrite-rules" () 2022-09-01 12:25:26 +00:00
Sven Anderson
846fab81b9
cgo: fix linters ignoring Cgo files () 2022-07-30 22:26:33 +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
36aa12425c
docs: Improve goimports description () 2021-07-07 22:14:02 +02:00
Sergey Vilgelm
c8bd9549a5
Support --fix for gofumpt () 2020-07-18 21:33:47 -05:00
Soichiro Kashima
7f48cc88b8
Fix lint errors on files with //line directive ()
If the target files contains `//line` directive and it indicates
a non-go file, the linter is going to handle it as a go file,
which results in failure.
The cause of this issue is that the linters (`Analyzer`s) are using
`pass.Fset.Position()`. This func returns the adjusted position using
`//line` directive.
The example project reported in  has `//line` directive that
indicates other non-go file.
According to the description of "Compiler Directives”
(https://golang.org/cmd/compile/#hdr-Compiler_Directives),
line directives is mainly used for reporting original positions to
the generators or something.
On linters of golangci-lint, `pass.Fset.Position()` is used just to
aggregate file names; we don't have to adjust positions.
This changes `Analyzer`s that use `pass.Fset.Position()` to aggregate
file names to use `pass.Fset.PositionFor()` with `adjusted == false`.

Relates: 
2020-05-05 18:49:34 +03:00
Isaev Denis
9ba730e989
Make incremental analysis ()
Cache linting results. Reanalyze only changed packages
and packages tree depending on them.

Fixes , fixes 
2019-10-13 17:40:51 +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