summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKyle Lahnakoski <klahnakoski@mozilla.com>2020-02-23 20:33:48 -0500
committerGitHub <noreply@github.com>2020-02-23 19:33:48 -0600
commit664d9e7e33e33fef48a4d8a36104be01ecfcd2f9 (patch)
tree0869c4dbfa01499d3158cca61d3d2642b6cdf864
parent22c76ec0f9dbf67f59afc56eaf9f5b043e4eef20 (diff)
downloadpyparsing-git-664d9e7e33e33fef48a4d8a36104be01ecfcd2f9.tar.gz
Add Black formatting Git hook (#180)
* add black git hook * test change * test instructions, fix instructions * spelling * make tox and pre-commit agree on line length * start guessing what the line length parameter really is * 80 char line length * 88?
-rw-r--r--.pre-commit-config.yaml7
-rw-r--r--tests/README.md10
-rw-r--r--tests/requirements.txt1
-rw-r--r--tox.ini2
4 files changed, 19 insertions, 1 deletions
diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml
new file mode 100644
index 0000000..36bc140
--- /dev/null
+++ b/.pre-commit-config.yaml
@@ -0,0 +1,7 @@
+repos:
+- repo: https://github.com/python/black
+ rev: stable
+ hooks:
+ - id: black
+ language_version: python3.6
+ line_length: 88
diff --git a/tests/README.md b/tests/README.md
new file mode 100644
index 0000000..87b8195
--- /dev/null
+++ b/tests/README.md
@@ -0,0 +1,10 @@
+## Development
+
+After forking the pyparsing repo, and cloning your fork locally, install the libraries needed to run tests
+
+ pip install -r tests/requirements.txt
+ pre-commit install
+
+Run the tests to ensure your environment is setup
+
+ python -m unittest discover tests
diff --git a/tests/requirements.txt b/tests/requirements.txt
index c765658..6711199 100644
--- a/tests/requirements.txt
+++ b/tests/requirements.txt
@@ -1,2 +1,3 @@
coverage==4.4.2
tox==3.5.2
+pre-commit
diff --git a/tox.ini b/tox.ini
index 4367fed..5bf8404 100644
--- a/tox.ini
+++ b/tox.ini
@@ -10,4 +10,4 @@ commands=
[testenv:black]
deps = black
-commands = {envbindir}/black --target-version py35 --check --diff .
+commands = {envbindir}/black --target-version py35 --line-length 88 --check --diff .