-
-
Notifications
You must be signed in to change notification settings - Fork 313
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
[Bug] Fix currently ignored Flake8 warnings #1522
Comments
Hi, I'm new to open source environments and coding, but I would like to work on this issue. If you can guide me a bit... |
Hi, that's great. Get the basic stuff first, like source code through Git and compile the source code (easiest on Linux, e.g., on Ubuntu). Then you can start making modifications. Given that GRASS GIS is not only Python, you need to recompile to test the code. What to test and how might be difficult to guess first, but often it won't be even needed depending on what you decide to fix from these issues, so I would just worry about it once you have an open PR to keep things simple at the beginning. I'm adding this info here for convenience, but the place to discuss this further is grass-dev mailing list. You don't need to subscribe, but it is the best place to discuss technical issues with your setup, compilation etc. You can also create an issue to ask for a better documentation if you can't find some information in the existing resources. |
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as off-topic.
This comment was marked as off-topic.
This comment was marked as off-topic.
This comment was marked as off-topic.
@echoix This issue might be a challenge to you :-) The list is long... |
I didn't see that issue yet, but I started a bit on my own without knowing. The part that I said "Should I make another PR with the missing fixes", it's because I had them in another branch (the commits that followed what I sent as a PR) |
As per the this entry on |
Can you point to the snippets you'd like an answer on? Probably they could be split without problems, html doesn't have to be exactly character perfect to still work and do the same thing |
Here are a couple of examples: These contain very little "texts" and more of tags and parameters, yet both of them trigger the warning. This reocurring pattern is basically leading to multiple |
Note: There is #3748 open which addresses E722 (do not use bare except), so that needs to be merged first before working specifically on E722. |
...well, or rewritten in a new PR or abandoned. There is a ton of conflicts. Have you already analyzed that @echoix by any chance? |
I'm note sure I understand what you are talking about, nor with the comment above. But regarding flake8, no, I didn't play with it really. I really prefer to work with ruff for rules that auto fix, or just for the rules they have implemented as the feedback cycle is so fast it just runs as you type in an IDE. So as a side effect, it helps for all the other linters, but partially (on what is implemented). So probably some ruff fixes I did helped some of flake8. But things like too many variables, too many functions, aren't really automatically actionnable. Remember that we started with a little debt, and we have a project with something like 391000 lines of Python code, that represents 31% of the lines of code of the project (last time I counted this summer). |
That's fine. Great answer. Sorry for not being clear. I will try to get to #3748 and see if how that compares to the Ruff changes. |
Fix one or more of the issues reported by Flake8.
This issue is not something which will be fixed by one PR. Instead, it serves as a pointer to the list of ignored warnings in the source code. Pick one or more issues or files, fix them, and submit a PR.
Getting the existing issues to fix
.flake8
files in the source tree.per-file-ignores
section.E741
orutils/mkrest.py
..flake8
file.flake8 --show-source --statistics
in the directory where the edited.flake8
file is.Note that all issues in the
per-file-ignores
section should be fixed unless noted otherwise. Some Flake8 warnings may be false positives or perhaps there is a good reason for the code to break some of the best practices. In that case, the issue should be ignored at the particular line using# noqa: ...
with a comment stating the reason for it.Finding .flake8 files
Currently, there is several
.flake8
files. To find them use, e.g., find:or ls
The current list is:
Example
At the time of writing, the file
./scripts/.flake8
contains linei.in.spotvgt/i.in.spotvgt.py: E722
in theper-file-ignores
section. Searching online for "Flake8 E722" leads to Flake8 Rules: Do not use bare except, specify exception instead page which explains the issue and a general guide on how to fix it.The text was updated successfully, but these errors were encountered: