From eb37b72dc1d4252fe8286e807e29e017c06f40e0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gina=20H=C3=A4u=C3=9Fge?= Date: Wed, 7 Oct 2020 18:04:07 +0200 Subject: [PATCH] =?UTF-8?q?=F0=9F=93=9D=20Document=20.git-blame-ignore-rev?= =?UTF-8?q?s?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- CONTRIBUTING.md | 22 +++++++++++----------- docs/development/environment.rst | 13 ++++++++++--- 2 files changed, 21 insertions(+), 14 deletions(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 7ef1c80916..068ea1c0a6 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -351,27 +351,27 @@ and branching strategy. by running ``` - pre-commit run --all-files + pre-commit run --hook-stage manual --all-files ``` in the OctoPrint checkout folder. If you install the pre-commit hooks via - `pre-commit install` this will even be taken care of for you prior to committing. + `pre-commit install` (which you really should!) this will even be taken care of for you prior to committing. An [automatic build workflow](https://github.com/OctoPrint/OctoPrint/actions?query=workflow%3ABuild) is in place that will run these checks - if they fail your PR will be marked accordingly. -9. **Test your changes thoroughly**. That also means testing with usage - scenarios you don't normally use, e.g. if you only use access control, test - without and vice versa. If you only test with your printer, test with the - virtual printer and vice versa. State in your pull request how you tested - your changes. Ideally **add unit tests** - OctoPrint severely lacks in that - department, but we are trying to change that, so any new code already covered - with a test suite helps a lot! -10. In your pull request's description, **state what your pull request does**, +10. **Test your changes thoroughly**. That also means testing with usage + scenarios you don't normally use, e.g. if you only use access control, test + without and vice versa. If you only test with your printer, test with the + virtual printer and vice versa. State in your pull request how you tested + your changes. Ideally **add unit tests** - OctoPrint severely lacks in that + department, but we are trying to change that, so any new code already covered + with a test suite helps a lot! +11. In your pull request's description, **state what your pull request does**, as in, what feature does it implement, what bug does it fix. The more thoroughly you explain your intent behind the PR here, the higher the chances it will get merged fast. There is a template provided below that can help you here. -11. Don't forget to **add yourself to the [AUTHORS](./AUTHORS.md) +12. Don't forget to **add yourself to the [AUTHORS](./AUTHORS.md) file** :) Template to use for Pull Request descriptions: diff --git a/docs/development/environment.rst b/docs/development/environment.rst index 46e6f337ac..964169d9c5 100644 --- a/docs/development/environment.rst +++ b/docs/development/environment.rst @@ -13,8 +13,8 @@ below. * Prerequisites: - * `Python 2.7 `_ including ``pip``, ``setuptools`` and ``virtualenv`` * `Python 3.7 `_ including ``pip``, ``setuptools`` and ``virtualenv`` + * `Python 2.7 `_ including ``pip``, ``setuptools`` and ``virtualenv`` * `Git `_ * Checkout the OctoPrint sources from their Git repository: @@ -26,8 +26,8 @@ below. installing and running OctoPrint and its dependencies. Creating virtual environments avoids potential versioning issues for the dependencies with system wide installed instances: - * PY2: ``virtualenv --python=python2 venv2`` * PY3: ``virtualenv --python=python3 venv3`` + * PY2: ``virtualenv --python=python2 venv2`` .. note:: @@ -54,12 +54,16 @@ below. * ``pre-commit install`` + * Tell ``git`` where to find the file with revisions to exclude for ``git blame``: + + * ``git config blame.ignoreRevsFile .git-blame-ignore-revs`` + When the virtual environment is activated you can then: * run the OctoPrint server via ``octoprint serve`` * run the test suite from the checked out source folder via ``pytest`` * trigger the pre-commit check suite manually from the checked out source folder via - ``pre-commit run --all-files`` + ``pre-commit run --hook-stage manual --all-files`` To switch the activated virtual environment, simply activate the new environment as described above. @@ -114,6 +118,7 @@ Then: pip install --upgrade pip pip install -e .[develop,plugins,docs] pre-commit install + git config blame.ignoreRevsFile .git-blame-ignore-revs You can then start OctoPrint via ``octoprint`` after activating one of the two virtual environments. @@ -158,6 +163,7 @@ Open the Git Bash you just installed and in that: pip install --upgrade pip pip install -e .[develop,plugins,docs] pre-commit install + git config blame.ignoreRevsFile .git-blame-ignore-revs .. _sec-development-environment-mac: @@ -208,6 +214,7 @@ You'll need a user account with administrator privileges. pip install --upgrade pip pip install -e .[develop,plugins] pre-commit install + git config blame.ignoreRevsFile .git-blame-ignore-revs .. _sec-development-environment-ides: