Skip to content

Switch to flake8 for static code analysis #1328

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 1 commit into from
Apr 16, 2020
Merged

Switch to flake8 for static code analysis #1328

merged 1 commit into from
Apr 16, 2020

Conversation

jdufresne
Copy link
Contributor

flake8 catches a wider net of mistakes than pycodestyle and is more
commonly used by the larger community. For example, it catches unused
imports, a few of which existed. These have since been removed.

Two "noqa" comments were added. One ignores the _compat.py file as it
has a large amount of Python version specific code. The second is in
utils.py which intentionally does not use an import.

Pull Request check-list

Please make sure to review and check all of these items:

  • Does $ tox pass with this change (including linting)?
  • Does travis tests pass with this change (enable it first in your forked repo and wait for the travis build to finish)?
  • Is the new or changed code fully tested?
  • Is a documentation update included (if this change modifies existing APIs, or introduces new ones)?

flake8 catches a wider net of mistakes than pycodestyle and is more
commonly used by the larger community. For example, it catches unused
imports, a few of which existed. These have since been removed.

Two "noqa" comments were added. One ignores the _compat.py file as it
has a large amount of Python version specific code. The second is in
utils.py which intentionally does not use an import.
@codecov-io
Copy link

codecov-io commented Apr 13, 2020

Codecov Report

Merging #1328 into master will decrease coverage by 0.00%.
The diff coverage is 100.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #1328      +/-   ##
==========================================
- Coverage   92.88%   92.87%   -0.01%     
==========================================
  Files          20       20              
  Lines        6545     6543       -2     
==========================================
- Hits         6079     6077       -2     
  Misses        466      466              
Impacted Files Coverage Δ
redis/_compat.py 87.09% <ø> (ø)
redis/client.py 86.26% <ø> (-0.01%) ⬇️
redis/connection.py 82.32% <ø> (-0.03%) ⬇️
redis/utils.py 68.75% <100.00%> (ø)

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 ae173f0...638f397. Read the comment docs.

Copy link
Contributor

@laixintao laixintao left a comment

Choose a reason for hiding this comment

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

+1 on this

@andymccurdy
Copy link
Contributor

Ya, should have done this sooner. I use flake8 in my dev environment already :)

@andymccurdy andymccurdy merged commit 05548a3 into redis:master Apr 16, 2020
@jdufresne jdufresne deleted the flake8 branch April 16, 2020 22:29
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