Bläddra i källkod

Installed and configured pre-commit to lint and format code. Fixes #7476

Michael Deyaso 2 år sedan
förälder
incheckning
98d1c65b40
3 ändrade filer med 18 tillägg och 0 borttagningar
  1. 10 0
      .pre-commit-config.yaml
  2. 7 0
      docs/development.rst
  3. 1 0
      requirements.d/development.txt

+ 10 - 0
.pre-commit-config.yaml

@@ -0,0 +1,10 @@
+repos:
+-   repo: https://github.com/psf/black
+    rev: 22.10.0
+    hooks:
+    -   id: black
+-   repo: https://github.com/pycqa/flake8
+    rev: 6.0.0
+    hooks:
+    -   id: flake8
+        files: '(src|scripts|conftest.py)'

+ 7 - 0
docs/development.rst

@@ -179,6 +179,13 @@ virtual env and run::
   pip install -r requirements.d/development.txt
 
 
+This project utilizes pre-commit to format and lint code before it is committed.
+Although pre-commit is installed when running the command above, the pre-commit hooks
+will have to be installed separately. Run this command to install the pre-commit hooks::
+
+  pre-commit install
+
+
 Running the tests
 -----------------
 

+ 1 - 0
requirements.d/development.txt

@@ -10,3 +10,4 @@ pytest-cov
 pytest-benchmark
 Cython
 twine
+pre-commit