You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I am trying to use pre-commit instead of git-pylint-commit-hook for the pitivi project, but we depend on gobject-introspection and running pylint with pre-commit on our code we get:
Traceback (most recent call last):
File "/home/thiblahute/.pre-commit/reporeumijub/py_env-default/bin/pylint", line 11, in <module>
sys.exit(run_pylint())
File "/home/thiblahute/.pre-commit/reporeumijub/py_env-default/lib/python3.5/site-packages/pylint/__init__.py", line 23, in run_pylint
Run(sys.argv[1:])
File "/home/thiblahute/.pre-commit/reporeumijub/py_env-default/lib/python3.5/site-packages/pylint/lint.py", line 1273, in __init__
'init-hook')))
File "/home/thiblahute/.pre-commit/reporeumijub/py_env-default/lib/python3.5/site-packages/pylint/lint.py", line 1374, in cb_init_hook
exec(value) # pylint: disable=exec-used
File "<string>", line 1, in <module>
ImportError: No module named 'gi'
I know there is a additional_dependencies but for our case it means installing way to much things in the virtual environment and I think it does not make sense, and would be pretty complex, also we already have our own development environment. Maybe I am missing something but I can not find how that should be solved.
Ah yes, pylint does more than static analysis so it needs to both import your code and your dependencies.
There's a supported way to do this through "local" (system) hooks (which still need documentation :/) pre-commit/pre-commit.com#50 -- You can also share a configured "system" hook (in a repo) if that makes more sense for you.
Activity
asottile commentedon Apr 7, 2016
Ah yes, pylint does more than static analysis so it needs to both import your code and your dependencies.
There's a supported way to do this through "local" (system) hooks (which still need documentation :/) pre-commit/pre-commit.com#50 -- You can also share a configured "system" hook (in a repo) if that makes more sense for you.
Here's an example for how you can do this: https://github.com/Yelp/venv-update/blob/2a57651bb192770ec0e55171a1c2fdaa30c3fb8d/.pre-commit-config.yaml#L29-L35
asottile commentedon May 4, 2016
local hooks are now documented here: http://pre-commit.com/#repository-local-hooks
Merge pull request pre-commit#362 from revolter/patch-1