Comment annotations to ignore
yang opened this issue · comments
This has found quite a few issues in my code bases - thanks! It would be awesome to have a way to "bless" certain assignments as intentional, e.g. via a special comment annotation on the preceding line.
@yang Thanks! I had a look at it the other day and it may take me a while. If you have any ideas how to implement it feel free to make a PR.
If this rule sticks with just using the AST, you'll need to use block comments.
# This can't be found
##
# but this can
##
It might be possible to run regex over the code, but then you have to try to match up line numbers and inject these blessings at the right time instead of processing them as you encounter them. I hope this helps.