parser: Use #-space-% to allow writing PEP8-compliant Python code#693
parser: Use #-space-% to allow writing PEP8-compliant Python code#693neteler merged 3 commits intoOSGeo:grass8from neteler:parser_pep8_comment_space
Conversation
Change `#%` in parser script header definition to `# %` because `#%` is against PEP8 (each line of a block comment starts with a `#` and a single space). This PR follows the changes in OSGeo/grass#1287
|
Perhaps anything still to change in |
anikaweinmann
left a comment
There was a problem hiding this comment.
Looks good for me. Maybe you can now remove https://github.com/OSGeo/grass-addons/blob/grass8/.flake8#L5
Good idea. I have removed it in 1ba196c, let's see... |
Nice attempt but failing: all comments are now rejected. I'll re-instate flake8 E265. |
I totally agree that this should lead to removal of E265 from the Not all comment are rejected. It's just the comments with the The The |
There was a problem hiding this comment.
Thank you. Yes, this should happen for the grass8 branch and I see no no suspicious lines using grep -vE "#%|# %|^-$|^\+$|^ " 693.diff. Edit: And there is nothing to see when you do Files changed > settings gear wheel > Hide whitespace > Apply and reload, so that's good.
Ok, I can try to fix the code in order to eventually remove E265. But at time I don't get I do not plan to fix tons of Python addons to get this PR merged... :) |
I don't think you should. Just merge this as is now.
That would be great. Thank you.
Your flake8 command works for me with Flake8 3.8.3 (mccabe: 0.6.1, pycodestyle: 2.6.0, pyflakes: 2.2.0) CPython 3.8.10 on Linux (
We are running Python 3.8 in the CI, so Python 3.10 may behave differently. The particular error is traceback with a SyntaxError rather than a Flake8 warning. For me, even For you, it seems this will fail with traceback instead of reporting all the issues. In the CI, we don't have an explicit check for Python 3 compatibility other than running Flake8 (which should be enough), but the E999 SyntaxError warning is disabled.
I think you are doing it right. Yes, it should report a Flake8 error message, not a traceback, but that might be a bug in Flake8 given that it reports other syntax errors without a traceback. A workaround is to "grep" for it. Given all this, enabling E999 in the CI (and fixing whatever is needed to make it pass) seems like a good next step. |
I tried on a different machine with Python 3.9: no such traceback errors. Seems that Python 3.10 changes things also in the However, removing E265 leads to 182 errors, i.e.
which should be addressed in a separate PR in my opinion. |
I think there is some misunderstanding. I never suggested to remove E265 from
To clarify: I'm all for merging this PR now. |
|
Yes it was only a suggestion and the hope that not to much has to be changed for the remove of E265. Since this is not the case, please feel free to merge and leave it in. |
…Geo#693) * parser: Use #-space-% to allow writing PEP8-compliant Python code Change `#%` in parser script header definition to `# %` because `#%` is against PEP8 (each line of a block comment starts with a `#` and a single space). This PR follows the changes in OSGeo/grass#1287
Change
#%in addons, parser script header definitions to# %because#%is against PEP8 (each line of a block comment starts with a#and a single space).This PR follows the changes in OSGeo/grass#1287