From a788fc255d13432388472492e8a248d4ae0b5dcd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gina=20H=C3=A4u=C3=9Fge?= Date: Wed, 7 Oct 2020 16:40:49 +0200 Subject: [PATCH] =?UTF-8?q?=F0=9F=93=9D=20Document=20pre-commit=20setup=20?= =?UTF-8?q?in=20pycharm?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- docs/development/environment.rst | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/docs/development/environment.rst b/docs/development/environment.rst index e8de5fc30..46e6f337a 100644 --- a/docs/development/environment.rst +++ b/docs/development/environment.rst @@ -286,6 +286,18 @@ PyCharm Note that this requires you to also have installed the additional ``docs`` dependencies into the Python 3 venv as described above via ``pip install -e .[develop,plugins,docs]``. + - Settings > Tools > File Watchers (you might have to enable this, it's a bundled plugin), add new: + + * Name: pre-commit + * File type: Python + * Scope: Module 'OctoPrint' + * Program: ``/bin/pre-commit`` (Linux) or ``/Scripts/pre-commit`` (Windows) + * Arguments: ``run --hook-stage manual --files $FilePath$`` + * Output paths to refresh: ``$FilePath$`` + * Working directory: ``$ProjectFileDir$`` + * disable "Auto-save edited files to trigger the watched" + * enable "Trigger the watched on external changes" + To switch between Python 2 and 3, all you need to do now is change the Project Default Interpreter and restart OctoPrint. On current PyCharm versions you can do that right from a small selection field in the footer of the IDE. Otherwise go through Settings.