-
I see that the following linters are now defined as formatters but two others that are dealing with whitespaces stays linters but not formatters I'd like to understand that distinction because I would have expected whitespace linters to be defined as formatter. |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 2 replies
-
Hello, there are 2 main differences:
This is the same difference as govet and gofmt.
We have a "bridge" to use formatters as a linter, but it's more of a convenience than their intended use. FYI, technically, |
Beta Was this translation helpful? Give feedback.
Hello,
there are 2 main differences:
This is the same difference as govet and gofmt.
wsl
,whitespace
, etc. are analyzers (analysis.Analyzer
), and are related to style (they don't format the code but detect style issues).gofmt
,goimports
, etc. are formatters (func(src []byte) []byte
), and are related to format (they don't detect style problems, they just apply a format).We have a "bridge" to use formatters as a linter, but it's more of a convenience than their intended use.
FYI, technically,
gci
,gofmt
,gofumpt
,goimports
have never been "linters"; they were just wrapped to fake a linter behavior.