From ba8deb51462504a4d6c34b8a0a4aa60b78deb11d Mon Sep 17 00:00:00 2001 From: Severin Ferrand <19885877+Seburan@users.noreply.github.com> Date: Wed, 6 Dec 2023 11:13:19 +0900 Subject: [PATCH] [doc] update the contributing guide add instructions for code linting with pre-commit --- CONTRIBUTING.md | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 80bdff78..eeaa30b6 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -15,3 +15,28 @@ do it again. All submissions, including submissions by project members, require review. We use GitHub pull requests for this purpose. Consult [GitHub Help](https://help.github.com/articles/about-pull-requests/) for more information on using pull requests. + +## Code linting + +We use a pre-commit hook to clean/format code before submitting a change. This allows for a cleaner code base. pre-commit will fetch and trigger the +_prettier_ and _markdown_ link tools and run it through your staged files. + +Install pre-commit on your cloud top + +```shell +sudo apt install pre-commit +``` + +Then install the git hook : + +```shell +pre-commit install +``` + +you can also run pre-commit on all the files manually before committing your changes : + +```shell +pre-commit run --all-files +``` + +more information about pre-commit :