From 753e9dcfd47f5a35b4a5305eecf8c70b8b5efc98 Mon Sep 17 00:00:00 2001 From: jo Date: Fri, 18 Nov 2022 22:49:04 +0100 Subject: [PATCH] docs: add instruction on how to use pre-commit --- .../workflows/index.md | 1 + .../workflows/pre-commit.md | 20 +++++++++++++++++++ 2 files changed, 21 insertions(+) create mode 100644 docs/developer_documentation/workflows/pre-commit.md diff --git a/docs/developer_documentation/workflows/index.md b/docs/developer_documentation/workflows/index.md index 5d58a815d..7607e33a2 100644 --- a/docs/developer_documentation/workflows/index.md +++ b/docs/developer_documentation/workflows/index.md @@ -9,6 +9,7 @@ maxdepth: 1 --- git +pre-commit changelog release diff --git a/docs/developer_documentation/workflows/pre-commit.md b/docs/developer_documentation/workflows/pre-commit.md new file mode 100644 index 000000000..b6c9ed443 --- /dev/null +++ b/docs/developer_documentation/workflows/pre-commit.md @@ -0,0 +1,20 @@ +# Pre-commit + +Funkwhale uses [pre-commit](https://pre-commit.com/) to ensure that the files you commit are properly formatted, follow best practice, and don't contain syntax or spelling errors. + +You can install and setup pre-commit using the [quick-start guide on the pre-commit documentation](https://pre-commit.com/#quick-start). Make sure to install pre-commit and setup the git pre-commit hook so pre-commit runs before you commit any changes to the repository. + +The workflow looks like this: + +1. Install `pre-commit`. +2. After cloning the repository, setup the pre-commit git hooks: + + ```sh + git clone git@dev.funkwhale.audio:funkwhale/funkwhale.git + cd funkwhale + + pre-commit install + ``` + +3. Make your changes and commit them. +4. If `pre-commit` fails to validate your changes, the commit process stops. Fix any reported errors and try again.