aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--.pre-commit-config.yaml10
-rw-r--r--README.md11
2 files changed, 21 insertions, 0 deletions
diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml
new file mode 100644
index 000000000..e150bc80a
--- /dev/null
+++ b/.pre-commit-config.yaml
@@ -0,0 +1,10 @@
+---
+repos:
+ - repo: https://github.com/psf/black
+ rev: 22.12.0
+ hooks:
+ - id: black
+ - repo: https://github.com/PyCQA/pylint
+ rev: v2.15.9
+ hooks:
+ - id: pylint
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: