PreCommitHookPlugin icon indicating copy to clipboard operation
PreCommitHookPlugin copied to clipboard

Detecting Python virtualenv

Open MateuszBelczowski opened this issue 6 years ago • 1 comments

Is it possible to somehow detect virtualenv associated with a project in Pycharm? I'd like to run Pylint within pre-commit-hook.sh without hardcoding the path to that linter or installing it globally. What would you recommend?

MateuszBelczowski avatar May 08 '18 13:05 MateuszBelczowski

Hi @MateuszBelczowski, I believe you can parse .idea/misc.xml in your .sh file to know which SDK is used. (in the misc file only SDK name is specified, which can miss path information. In this case you can find path by SDK name in .idea/workspace.xml)

bugy avatar May 10 '18 11:05 bugy