-
Notifications
You must be signed in to change notification settings - Fork 361
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
Conversation
Dashes in key names are deprecated.
@@ -14,4 +14,3 @@ | |||
for entry_point | |||
in pkg_resources.iter_entry_points('ansible_runner.plugins') |
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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 :)
There was a problem hiding this 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.
There was a problem hiding this 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
I didn't get to this today, but I will tomorrow. |
This reverts commit 34d3a0c.
recheck |
max-line-length=160 | ||
ignore=E201,E203,E221,E225,E231,E241,E251,E261,E265,E303,W291,W391,W293,E731,F405 | ||
exclude=.tox,venv |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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
There was a problem hiding this 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 |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM!
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.