-
-
Notifications
You must be signed in to change notification settings - Fork 1.5k
Linter is confused by Ragel files and the subsequent autogenerated code #298
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
Comments
Doing some cursory investigation, and it seems that the autogeneration detection scans for certain comments that the Ragel generator does not provide. Might be that the problem is with us then. But, it feels weird that the linters try to parse the |
I added Notable; |
Upon further investigation, it seems that the error boils down to ineffassign only. Disabling it made the problem go away. Perhaps this should be an upstream bug to them? |
hi, the reason is that ragel-generated files contain directives like I will try to fix it. |
Hi! I've made some fixes for such issues. Please, check it in the latest release |
That's awesome! Unfortunately I have left the company in which these problems were present, so I will not be able to verify that it fixed the original case that I reported. Since I have no ways of checking if the provided fix solves the issue, you can feel free to close it as fixed. |
ok, sorry for delay =( |
At my company we use Ragel to define a state machine and parse structured data sets.
The interesting parts of the logs are the warnings that are printed just before the results start popping up;
Several errors happen here - possibly all related to the same issue:
.rl
files but fails (it's not Go code)NONE
for some of the errorsI tried adding
skip-files
, but it doesn't seem to listen about".*\\.rl$"
for some reason. Instead, an even weirder error about symbolink links to the Ragel files pop up (there are no symbolic links in our repo, so that one is Twilight Zone levels of weird to me).Also, since the config file suggests to let you know if the autogeneration detection doesn't work, consider this a notice that
_gen.go
does not seem to be recognized. 🙂Anyways, it seems to me that all of these issues are related to the linters thinking they should work on the Ragel files and their subsequent autogenerated code. I would suggest that this is wrong and that they should be skipped.
Version of golangci-lint:
golangci-lint --version
(or git commit if you don't use binary distribution)cb5d1da (one commit after
1.12.2
)Config file:
cat .golangci.yml
go version && go env
golangci-lint run -v
I've cleaned up these a bit by removing the huge AST file lists. If they are needed they can be provided.
The text was updated successfully, but these errors were encountered: