Skip to content
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

feat: add flake8-bugbear #4288

Merged
merged 5 commits into from
May 26, 2021
Merged

Conversation

jnoortheen
Copy link
Member

For community

⬇️ Please click the 👍 reaction instead of leaving a +1 or 👍 comment

Copy link
Contributor

@daniel-shimon daniel-shimon left a comment

Choose a reason for hiding this comment

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

These changes look nice, the question is whether we want to introduce yet another linter.
I'm OK with it, @gforsyth what do you think?

xonsh/inspectors.py Outdated Show resolved Hide resolved
@@ -362,7 +362,7 @@ def format_lazy_import(names):
def format_from_import(names):
"""Format a from import line"""
parts = []
for _, module, name, asname in names:
for _, module, name, asname in names: # noqa
Copy link
Contributor

Choose a reason for hiding this comment

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

Why not prepend an underscore to the unused vars?

Copy link
Member Author

Choose a reason for hiding this comment

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

that module is latter referenced

xonsh/completers/python.py Outdated Show resolved Hide resolved
@jnoortheen
Copy link
Member Author

the question is whether we want to introduce yet another linter.

This contains some important bug detection IMO

@gforsyth
Copy link
Collaborator

I'm not opposed. I think bugbear trips up fewer people because the errors are less common than, say, styling issues.

Two asks:
Can this also be added to the precommit config?
Can you remove the pylint bare except directives since they are no longer bare?

@jnoortheen
Copy link
Member Author

Two asks:
Can this also be added to the precommit config?

  1. do you want to add flake8 as whole? I think we can add it part of push checks.

Can you remove the pylint bare except directives since they are no longer bare?

  1. will update it.

@codecov-commenter
Copy link

codecov-commenter commented May 21, 2021

Codecov Report

Merging #4288 (0b1ae19) into main (38295a1) will decrease coverage by 0.00%.
The diff coverage is 1.85%.

Impacted file tree graph

@@           Coverage Diff            @@
##            main   #4288      +/-   ##
========================================
- Coverage   0.92%   0.92%   -0.01%     
========================================
  Files        130     130              
  Lines      20183   20186       +3     
  Branches    3638    3638              
========================================
  Hits         186     186              
- Misses     19989   19992       +3     
  Partials       8       8              
Impacted Files Coverage Δ
xonsh/base_shell.py 0.00% <0.00%> (ø)
xonsh/cli_utils.py 0.00% <0.00%> (ø)
xonsh/commands_cache.py 0.00% <0.00%> (ø)
xonsh/completers/bash_completion.py 0.00% <0.00%> (ø)
xonsh/completers/python.py 0.00% <0.00%> (ø)
xonsh/dirstack.py 0.00% <0.00%> (ø)
xonsh/history/json.py 0.00% <0.00%> (ø)
xonsh/inspectors.py 0.00% <0.00%> (ø)
xonsh/parsers/base.py 0.00% <0.00%> (ø)
xonsh/procs/posix.py 0.00% <0.00%> (ø)
... and 11 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 38295a1...0b1ae19. Read the comment docs.

@gforsyth
Copy link
Collaborator

Yeah, let's add flake8.

Then later we can run precommit itself during the style CI runs and so anyone running precommit locally will be guaranteed to pass on CI

@jnoortheen
Copy link
Member Author

Yeah, let's add flake8.

Then later we can run precommit itself during the style CI runs and so anyone running precommit locally will be guaranteed to pass on CI

added qa as whole to pre-commit hook. Added this as pre-push hook since it will take some time to run.
command to install this hook

pre-commit install --hook-type pre-push

@jnoortheen
Copy link
Member Author

what happened to the news-item checking action? it doesn't seem to be running for recent PRs.

Copy link
Collaborator

@gforsyth gforsyth left a comment

Choose a reason for hiding this comment

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

Changes here look good to me. @daniel-shimon -- anything else you want to see done here?

As for the news checks, @AstraLuma set them up ages ago and some webhook may not be firing anymore?
We can probably add a news check with github actions fairly easily.

@daniel-shimon
Copy link
Contributor

I think it's good - thanks @jnoortheen 👌

@daniel-shimon daniel-shimon merged commit 948129b into xonsh:main May 26, 2021
@jnoortheen jnoortheen deleted the flake8-bugbear branch May 27, 2021 06:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants