-
Notifications
You must be signed in to change notification settings - Fork 739
Merge flake8 configurations #1172
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
Conversation
.flake8
Outdated
| ignore = E305,E402,E721,E741,F401,F403,F405,F999,W503,W504 | ||
| exclude = build,docs/source,_ext,third_party | ||
| ignore = E305,E402,E721,E741,F401,F403,F405,W503,W504,F821,F841,F999 | ||
| exclude = build,docs/source,_ext,third_party,docs/src,venv,torch/lib/gloo,torch/lib/pybind11,torch/lib/nanopb |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's remove unused ones. Only build,docs/source,third_party are relevant and the others are originated from PyTorch core.
.flake8
Outdated
| max-line-length = 120 | ||
| ignore = E305,E402,E721,E741,F401,F403,F405,F999,W503,W504 | ||
| exclude = build,docs/source,_ext,third_party | ||
| ignore = E305,E402,E721,E741,F401,F403,F405,W503,W504,F821,F841,F999 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What happens if F821 and F841 are not added here? They should not be added here I think.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you also see what happens if removing 401, 402, 403, 405, 503, 504? I do not see a good reason in torchaudio that they should be ignored.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I agree that we should remove F821, F841
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
F503, F504 looks like its being ignore in pytorch too.
https://www.flake8rules.com/rules/W504.html
https://www.flake8rules.com/rules/W503.html
From what I understand they seem to be contradicting each other
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
403,405 being ignore by pytorch too. (Rule discouraging the use of * imports)
https://www.flake8rules.com/rules/F403.html
https://www.flake8rules.com/rules/F405.html
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Would it possible for you to fix it?
For __init__.pys, listing the imported stuff in __all__ would do. https://stackoverflow.com/a/31079085
For others, unused import should be removed.
If that uncovers other issues, (like unused imported function is used from external module). We can just give up and do it in a follow up.
|
@krishnakalyan3 I am merging this one now. If you would like to follow up on the change to the rule. Feel free to open a new PR. |
|
Thanks! |

#1053