sveinugu / pycharm_githooks_workaround

A set of scripts that solved the annoying issue in PyCharm that git-hooks are not run in the currently selected environment. Hack only works for Conda environments, but can easily be extended. See https://youtrack.jetbrains.com/issue/PY-12988.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

PyCharm / Conda / git-hooks workaround

Workaround to get PyCharm to run git-hooks within the same Conda environment that is selected the PyCharm project.

Only activates the Conda environment if PyCharm runs a git command that might be connected to a git-hook. This speeds up common PyCharm git command significantly.

Requirements:

  • Platform: MacOS (but the scripts might work with some modifications also on other platforms).
  • Shell: bash
  • miniconda (v3) installed using Homebrew (recommended approach to combining Homebrew and Conda)
  • Python v2 or v3

Setup:

PyCharm->Preferences->Version Control->git->Path to git executable: Select git_wrapper.sh. Can be set up globally (for all projects).

About

A set of scripts that solved the annoying issue in PyCharm that git-hooks are not run in the currently selected environment. Hack only works for Conda environments, but can easily be extended. See https://youtrack.jetbrains.com/issue/PY-12988.

License:MIT License


Languages

Language:Python 55.1%Language:Shell 44.9%