Skip to content

Conversation

@krishnakalyan3
Copy link
Contributor

@krishnakalyan3 krishnakalyan3 commented Jan 9, 2021

.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
Copy link
Contributor

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
Copy link
Contributor

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.

Copy link
Contributor

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.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Contributor Author

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

Copy link
Contributor Author

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

Copy link
Contributor Author

@krishnakalyan3 krishnakalyan3 Jan 10, 2021

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

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

image

looks like we have 401 violations.

Copy link
Contributor

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.

@mthrok mthrok merged commit 1bb1115 into pytorch:master Jan 11, 2021
@mthrok
Copy link
Contributor

mthrok commented Jan 11, 2021

@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.

@mthrok
Copy link
Contributor

mthrok commented Jan 11, 2021

Thanks!

@krishnakalyan3 krishnakalyan3 deleted the flake branch January 11, 2021 17:13
mpc001 pushed a commit to mpc001/audio that referenced this pull request Aug 4, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants