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

PEP8 and setuptools cleanup #761

Merged
merged 4 commits into from
Aug 4, 2021
Merged

PEP8 and setuptools cleanup #761

merged 4 commits into from
Aug 4, 2021

Conversation

samdoran
Copy link
Contributor

All the PEP8 rules that were ignored have to do with whitespace formatting which help keep the code readable. Fix all the rule violations and remove the ignored rules.

@samdoran samdoran requested review from eqrx and Shrews July 27, 2021 21:58
@@ -14,4 +14,3 @@
for entry_point
in pkg_resources.iter_entry_points('ansible_runner.plugins')
Copy link
Member

Choose a reason for hiding this comment

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

As a side note, I strongly encourage migrating to importlib in place of pkg_resources

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 will have to do that in a separate PR.

Copy link
Member

Choose a reason for hiding this comment

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

Sure, that's the way :)

Copy link
Member

@webknjaz webknjaz left a comment

Choose a reason for hiding this comment

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

Also, while you're at it, I recommend you integrate
https://github.com/pre-commit/pre-commit-hooks#trailing-whitespace
into .pre-commit-config.yaml. And use pre-commit in the linters tox env so that it's actually being executed. This small change would help keep the project free of trailing whitespaces.

Copy link
Contributor

@eqrx eqrx left a comment

Choose a reason for hiding this comment

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

Thanks you very much for doign the linting first, I find it important :) I agree with @webknjaz that the underscore changes in setup.py should be split into another PR

@samdoran
Copy link
Contributor Author

I didn't get to this today, but I will tomorrow.

@Shrews
Copy link
Contributor

Shrews commented Jul 30, 2021

recheck

max-line-length=160
ignore=E201,E203,E221,E225,E231,E241,E251,E261,E265,E303,W291,W391,W293,E731,F405
exclude=.tox,venv
Copy link
Member

Choose a reason for hiding this comment

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

While I'm on it, let me inform you that https://flake8.pycqa.org/en/latest/user/options.html#cmdoption-flake8-extend-exclude exists. Of course, it's best to change it in a separate PR too.

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 it would probably be better to use extend-exclude. The default list of .svn,CVS,.bzr,.hg,.git,__pycache__,.tox,.eggs,*.egg

Copy link
Contributor

@Shrews Shrews left a comment

Choose a reason for hiding this comment

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

Fine with the changes here. If we can determine we don't need the [pep8] section, I'd rather see that removed in this change.

# W293 - Blank line contains whitespace
ignore=E201,E203,E221,E225,E231,E241,E251,E261,E265,E303,W291,W391,W293
# W503 - Line break occurred before a binary operator
ignore=W503
Copy link
Contributor

Choose a reason for hiding this comment

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

Do we even need this [pep8] section? We only run flake8 during the tests.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Looks like that is only used my autopep8. If we have no plans to use that, we can remove it.

@shanemcd shanemcd added the gate label Aug 4, 2021
Copy link
Contributor

@ansible-zuul ansible-zuul bot left a comment

Choose a reason for hiding this comment

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

LGTM!

@ansible-zuul ansible-zuul bot merged commit cdc0961 into ansible:devel Aug 4, 2021
@samdoran samdoran deleted the cleanup branch August 4, 2021 21:07
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.

5 participants