Skip to content

Fix all issues reported by running: tox -e pep8 and enable pep8 as a linter check #1397

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
Apr 23, 2021
Merged

Fix all issues reported by running: tox -e pep8 and enable pep8 as a linter check #1397

merged 5 commits into from
Apr 23, 2021

Conversation

JohnVillalovos
Copy link
Member

@JohnVillalovos JohnVillalovos commented Apr 17, 2021

Fixed all the issues reported by flake8 when running tox -e pep8.

Separated them into individual commits for fixing different reported flake8 errors.

Finally enabled the tox -e pep8 to run as part of the CI linting process.

NOTE

In the F841 patch, I deleted the line:
parser = _get_base_parser(add_help=False)

As it doesn't seem have any impact. Please correct me if I am wrong.


Closes #1368.

@JohnVillalovos JohnVillalovos marked this pull request as draft April 17, 2021 21:21
@codecov-commenter
Copy link

codecov-commenter commented Apr 17, 2021

Codecov Report

Merging #1397 (89fc26f) into master (af781c1) will increase coverage by 0.04%.
The diff coverage is 100.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #1397      +/-   ##
==========================================
+ Coverage   80.10%   80.15%   +0.04%     
==========================================
  Files          73       73              
  Lines        4061     4066       +5     
==========================================
+ Hits         3253     3259       +6     
+ Misses        808      807       -1     
Flag Coverage Δ
unit 80.15% <100.00%> (+0.04%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
gitlab/mixins.py 77.47% <ø> (ø)
gitlab/v4/objects/events.py 100.00% <ø> (ø)
gitlab/v4/objects/milestones.py 69.81% <ø> (ø)
gitlab/v4/objects/releases.py 100.00% <ø> (ø)
gitlab/v4/objects/services.py 100.00% <ø> (ø)
gitlab/__init__.py 100.00% <100.00%> (ø)
gitlab/cli.py 54.05% <100.00%> (+0.48%) ⬆️
gitlab/v4/objects/__init__.py 100.00% <100.00%> (ø)
gitlab/v4/objects/commits.py 78.26% <100.00%> (ø)
gitlab/v4/objects/discussions.py 100.00% <100.00%> (ø)
... and 14 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 af781c1...89fc26f. Read the comment docs.

@JohnVillalovos JohnVillalovos changed the title Jlvillal/flake8 Fix all issues reported by running: tox -e pep8 Apr 17, 2021
@JohnVillalovos JohnVillalovos changed the title Fix all issues reported by running: tox -e pep8 Fix all issues reported by running: tox -e pep8 and enable pep8 as a linter check Apr 17, 2021
@JohnVillalovos JohnVillalovos marked this pull request as ready for review April 17, 2021 22:17
Copy link
Member

@nejch nejch left a comment

Choose a reason for hiding this comment

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

Awesome! Just a few nitpicks from me, and I think that you might get a few more violations if you resolve conflicts from master as I just merged a few things 😊

@nejch
Copy link
Member

nejch commented Apr 18, 2021

Also this closes #1368 IMO, at least assuming the default tox run, I've updated the PR for that.

I agree about _get_base_parser() :) maybe it was a copy/paste actually, or needed before when we still had more dynamic imports.

Fixes to resolve errors for:
    https://www.flake8rules.com/rules/E741.html
      Do not use variables named 'I', 'O', or 'l' (E741)

    https://www.flake8rules.com/rules/E742.html
      Do not define classes named 'I', 'O', or 'l' (E742)
E712: Comparison to true should be 'if cond is true:' or 'if cond:'

https://www.flake8rules.com/rules/E712.html
@JohnVillalovos
Copy link
Member Author

Thanks for the feedback. I just did a quick rebase. Will work on updating based on your comments.

@JohnVillalovos JohnVillalovos requested a review from nejch April 18, 2021 15:29
@JohnVillalovos
Copy link
Member Author

I think I have updated everything you requested.

@nejch
Copy link
Member

nejch commented Apr 21, 2021

@max-wittig could we disable the black check and enable linters instead here? So this becomes mergeable.

This runs all the linters from tox which also avoids our previous issue with the black action having no proper versioning atm :)

@max-wittig
Copy link
Member

These are really nice little fixes 👍

@nejch I think, I can just force merge and next time, the Github actions thingy will adjust to the new config, right?

@max-wittig max-wittig merged commit 976e14d into python-gitlab:master Apr 23, 2021
@JohnVillalovos JohnVillalovos deleted the jlvillal/flake8 branch April 23, 2021 13:05
@JohnVillalovos
Copy link
Member Author

@nejch I think, I can just force merge and next time, the Github actions thingy will adjust to the new config, right?

@max-wittig / @nejch

I think someone has to fix the "expected check" in the Gitlab settings.

https://docs.github.com/en/github/administering-a-repository/managing-a-branch-protection-rule

I just rebased: #1352

And it shows that "black" is an "expected check".

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.

2.6.0: pytest based test suite is failing
4 participants