aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJohn Helmert III <ajak@gentoo.org>2022-12-01 12:33:59 -0600
committerJohn Helmert III <ajak@gentoo.org>2023-01-01 12:33:28 -0600
commit9fd0f840f7d3ab9b4b91ea90ea3bd8255bc3b891 (patch)
tree8d330989c9a8380bf1500f690826e5f3aa9ee01d /README.md
parentbin: pass -S to file to disable seccomp (diff)
downloadportage-9fd0f840f7d3ab9b4b91ea90ea3bd8255bc3b891.tar.gz
portage-9fd0f840f7d3ab9b4b91ea90ea3bd8255bc3b891.tar.bz2
portage-9fd0f840f7d3ab9b4b91ea90ea3bd8255bc3b891.zip
Add a pre-commit config
Using pre-commit instead of a manually written pre-commit hook will run the linter only over files that have changes, resulting in a much faster linting hook. Closes: https://github.com/gentoo/portage/pull/954 Signed-off-by: John Helmert III <ajak@gentoo.org>
Diffstat (limited to 'README.md')
-rw-r--r--README.md11
1 files changed, 11 insertions, 0 deletions
diff --git a/README.md b/README.md
index 188503b81..08b06c10f 100644
--- a/README.md
+++ b/README.md
@@ -30,6 +30,17 @@ editor integration. Something like this:
black --check --diff .
```
+One can also use pre-commit to run the configured pre-commit
+hooks. Utilizing pre-commit has the advantage of running the linter
+over only the changed files, resulting in a much faster pre-commit
+hook. To use, install pre-commit and then install the hook to your
+.git:
+
+```sh
+emerge dev-vcs/pre-commit
+pre-commit install
+```
+
To ignore commit 1bb64ff452 (and other reformatting commits) which is a
massive commit that simply formatted the code base using black - you can do
the following: