Skip to content

Add flake8-bugbear plugin to pre-commit and fix "tests" accordingly #8398

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

Merged
merged 5 commits into from
Jun 5, 2020

Conversation

deveshks
Copy link
Contributor

@deveshks deveshks commented Jun 4, 2020

Towards #5537

This adds flake8-bugbear plugin to pre-commit, and fixes the relevant errors just in the tests folder.

If the direction of this PR looks good, a follow up PR will remove warnings from src/pip/_internal folder for flake8-bugbear

@deveshks deveshks changed the title Add flake8-bugbear to tests Add flake8-bugbear plugin to pre-commit and fix "tests" accordingly Jun 4, 2020
@deveshks deveshks force-pushed the add-flake8-bugbear branch 2 times, most recently from 3048b4b to 59b27ad Compare June 4, 2020 21:55
Copy link
Contributor

@asottile asottile left a comment

Choose a reason for hiding this comment

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

@deveshks deveshks force-pushed the add-flake8-bugbear branch from 59b27ad to b542e21 Compare June 4, 2020 22:07
Copy link
Member

@uranusjr uranusjr left a comment

Choose a reason for hiding this comment

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

The configurations look good to me. Any recommendation if I want to run flake8 manually on the code base? Is it enough to simply install flake8-bugbear? I want to set up some editor integrations without using pre-commit for performance reasons.

@deveshks
Copy link
Contributor Author

deveshks commented Jun 5, 2020

The configurations look good to me. Any recommendation if I want to run flake8 manually on the code base? Is it enough to simply install flake8-bugbear? I want to set up some editor integrations without using pre-commit for performance reasons.

Thanks for the approval. Yep, after installing flake8-bugbear, you should see it being listed in flake8 --version. Then you can either do flake8 --select=W,E,F,B, or flake8 --enable-extensions=B when running manually just for bugbear.

Also if you are running flake8 on pip code, the config will be automatically picked up from setup.cfg but I assume that's not what you are looking for.

More details can be found in the docs at https://flake8.pycqa.org/en/latest/user/configuration.html#configuring-flake8

If I missed something here, @asottile can chime in as well with his suggestions.

@deveshks deveshks force-pushed the add-flake8-bugbear branch from b542e21 to e8535da Compare June 5, 2020 04:31
@deveshks
Copy link
Contributor Author

deveshks commented Jun 5, 2020

I think this is good to go and can be merged. I will create the next PR to add flake8-bugbear to the src/pip folder.

@deveshks deveshks force-pushed the add-flake8-bugbear branch from e8535da to 7744bd2 Compare June 5, 2020 16:46
@deveshks deveshks force-pushed the add-flake8-bugbear branch from 7744bd2 to 06654ef Compare June 5, 2020 17:40
@sbidoul sbidoul merged commit 3c6a25c into pypa:master Jun 5, 2020
@sbidoul
Copy link
Member

sbidoul commented Jun 5, 2020

Thanks!

@deveshks
Copy link
Contributor Author

deveshks commented Jun 5, 2020

Thanks!

Thanks for the merge :) The follow PR has been filed, please have a look

@deveshks deveshks deleted the add-flake8-bugbear branch June 5, 2020 20:56
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Oct 13, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants