Soichiro Kashima 7f48cc88b8
Fix lint errors on files with //line directive (#1065)
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 #998 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: #998
2020-05-05 18:49:34 +03:00
..
2018-10-28 17:55:15 +03:00
2020-04-27 19:19:12 +03:00
2019-09-09 21:54:56 +03:00
2018-06-30 09:23:31 +03:00
2019-10-13 17:40:51 +03:00
2019-09-17 08:44:53 +03:00
2019-09-09 16:56:30 +03:00
2019-10-04 11:29:53 -04:00
2020-03-16 11:56:57 +03:00
2020-04-27 21:37:34 +03:00
2019-09-20 19:05:01 +03:00
2018-06-30 15:41:47 +03:00
2020-04-22 08:51:43 +09:00
2020-04-26 20:20:17 -07:00
2020-04-26 20:20:17 -07:00
2020-03-10 14:55:19 +01:00
2020-04-22 18:57:30 +03:00
2019-11-15 18:55:54 -05:00