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
Use start of identifier as start position #43
Comments
It's possible to do it that way, we just need to extract more information in our AST visiting classes to grab the column number (we presently only grab the line number). |
(Finally getting around to reporting the bugs as you suggested here @sigmavirus24 😛) |
I KNOW NOTHING! =P |
So I've hacked this in, but in running mccabe against itself, I've get:
And what's specifically bothersome to me is
And the fact that I can find other places where similar formatting for the name is being done. Are you doing this for flake8 or for mccabe specifically because that output is far from useful. |
This allows tools like Flake8 to report a column number (that is not 0) for users who care about the column number (in the case of the bug report a tool that integrates with a text editor). Related-to #43
The modifications in the If I understand #44 correctly that would be the same as how it currently will work when AtomLinter/linter-flake8#304 lands, as then it will use the default behavior (which in this case would ignore the whitespace at the start of the line, and select the first "word" as defined by the language, or in other words If getting the identifier is posing as much of a problem as it appears to be, returning the correct column for the base node will at least get a meaningful column number being reported to users. |
It's not posing a problem. I haven't really much tried it. I'm just thinking that in the larger scheme of how things work with Flake8, this isn't how things are typically reported. If there's a problem with a function, the position of |
If that's the way things are done currently that's probably the better way to go. |
Did I never send/merge a PR for this? |
I did! #44 |
Would it be possible to have the ranges reported by this tool updated to start at the start of the offending identifier?
For example with the following code:
This module simply reports the start of the line as the problem location:
If the identifier start was reported instead, the positions would be
5:5
and21:9
respectively. As it stands right now the column number is just plain wrong.The text was updated successfully, but these errors were encountered: