Describe the bug
When using JSON as the formatter, the package-comments rule reports that the issue starts at the very beginning of the file and spans to the last line, which I think is unexpected.
To Reproduce
Steps to reproduce the behavior:
Get latest revive release
Run it against its own codebase, using --formatter json
It should report an issue on main.go, that spans the entire file.
> pwd
/work/revive
> revive --formatter json
[{"Severity":"warning","Failure":"should have a package comment","RuleName":"package-comments","Category":"comments","Position":{"Start":{"Filename":"main.go","Offset":0,"Line":1,"Column":1},"End":{"Filename":"main.go","Offset":86,"Line":7,"Column":2}},"Confidence":1,"ReplacementLine":""}]
Expected behavior
Instead, revive should report only the line containing package xyz, which is the target of the missing comment:
> pwd
/work/revive
> revive --formatter json
[{"Severity":"warning","Failure":"should have a package comment","RuleName":"package-comments","Category":"comments","Position":{"Start":{"Filename":"main.go","Offset":0,"Line":1,"Column":1},"End":{"Filename":"main.go","Offset":12,"Line":1,"Column":13}},"Confidence":1,"ReplacementLine":""}]
Describe the bug When using JSON as the formatter, the package-comments rule reports that the issue starts at the very beginning of the file and spans to the last line, which I think is unexpected.
To Reproduce Steps to reproduce the behavior:
--formatter json
main.go
, that spans the entire file.Expected behavior Instead, revive should report only the line containing
package xyz
, which is the target of the missing comment:Logs N/A