Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Calculate correct position with comments before the package keyword #215

Merged
merged 1 commit into from
Jul 11, 2022

Conversation

rmohr
Copy link
Contributor

@rmohr rmohr commented Jul 8, 2022

Detect the file beginning by using pass.Fset.File(f.Pos()) instead of
assuming that f.Pos() is always the beginning of the file.

f.Pos() is the position of the package keyword which does not always correlate with the beginning of the file. f.Pos() is not the beginning of the file when there is for instance a
comment before the package, which can lead to wrong reportings of the
actual error position.

Detect the file beginning by using `pass.Fset.File(f.Pos())` instead of
assuming that `f.Pos()` is always the beginning of the file.

`f.Pos()` is not the beginning of the file when there is for instance a
comment before the package, which can lead to wrong reportings of the
actual error position.

Signed-off-by: Roman Mohr <rmohr@google.com>
@rmohr
Copy link
Contributor Author

rmohr commented Jul 8, 2022

@maiqueb FYI

@rmohr
Copy link
Contributor Author

rmohr commented Jul 8, 2022

@kisielk thanks for maintaining this great linter.

@kisielk
Copy link
Owner

kisielk commented Jul 11, 2022

Looks good to me, can't believe it's been unreported for so long :)

@kisielk kisielk merged commit 3faf0bc into kisielk:master Jul 11, 2022
@maiqueb
Copy link

maiqueb commented Aug 3, 2022

@kisielk would you be willing to create a release container this fix ?

We're keen on it for kubevirt/kubevirt#8058

@kisielk
Copy link
Owner

kisielk commented Aug 3, 2022

@maiqueb I just created v1.6.2 which contains the fix. Thanks

@maiqueb
Copy link

maiqueb commented Aug 4, 2022

@maiqueb I just created v1.6.2 which contains the fix. Thanks

Thank you :) Highly appreciated.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants