-
Notifications
You must be signed in to change notification settings - Fork 4
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
Run pylint in pre-commit system hook #7
Conversation
.pre-commit-config.yaml
Outdated
@@ -7,6 +7,13 @@ repos: | |||
language: script | |||
entry: scripts/check_commit_message | |||
stages: [commit-msg] | |||
- id: pylint | |||
name: pylint | |||
entry: python -m pylint.__main__ |
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.
does simply pylint
not work?
can you provide a link to the github issue which prompted this?
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.
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 believe running pylint
is guaranteed to work as long as it is correctly installed - it uses distutils
in setup.py
to setup system wide alias. So let's keep thing simple.
Codecov Report
@@ Coverage Diff @@
## master #7 +/- ##
=======================================
Coverage 71.59% 71.59%
=======================================
Files 17 17
Lines 352 352
=======================================
Hits 252 252
Misses 100 100 Continue to review full report at Codecov.
|
I will force commit once this is rebased. please ping me. |
`pylint` is available system wide as long as it is installed correctly (via setup.py)
948ede5
to
5594cb6
Compare
@ryanjulian rebased. |
If I install |
@ryanjulian It works if installed by pip. I will check for conda and virtualenv to make sure. |
Okay, I think if it works if installed by pip then it should work in conda and virtualenv. That's the beauty of packages. |
Confirmed that straight |
Pre-commit runs in an isolated environment. As a result, the built-in pylint can only do static check but not dynamic import check. This PR fixs this issue by calling pylint in a pre-commit "system hook" as suggested here.