summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDavid Moreau Simard <dmsimard@redhat.com>2018-10-02 16:46:01 -0500
committerDavid Moreau Simard <dmsimard@redhat.com>2018-10-02 16:46:01 -0500
commit001112df9fcce34b5aa2e8cc4527d57a72712128 (patch)
treec5e308c1333a26f334528f765ebdf1361b12c5fb
parentb1dc3a0944d15d4c6db995d39b90e78abfd3578f (diff)
Add zuul job to run tox-format environment for executing black and isort
This will allow us to have more consistent and clean code. Change-Id: I8a49053d016c52b7b44136a6a8f36f9ad12675c3
Notes
Notes (review): Code-Review+2: David Moreau Simard <dmsimard@redhat.com> Workflow+1: David Moreau Simard <dmsimard@redhat.com> Verified+2: Zuul Submitted-by: Zuul Submitted-at: Wed, 03 Oct 2018 14:30:21 +0000 Reviewed-on: https://review.openstack.org/607374 Project: openstack/ara-clients Branch: refs/heads/master
-rw-r--r--.zuul.yaml2
-rw-r--r--pyproject.toml2
-rw-r--r--setup.cfg22
-rw-r--r--test-requirements.txt2
-rw-r--r--tox.ini14
5 files changed, 32 insertions, 10 deletions
diff --git a/.zuul.yaml b/.zuul.yaml
index 9147299..f222942 100644
--- a/.zuul.yaml
+++ b/.zuul.yaml
@@ -1,7 +1,9 @@
1- project: 1- project:
2 check: 2 check:
3 jobs: 3 jobs:
4 - tox-format
4 - tox-pep8 5 - tox-pep8
5 gate: 6 gate:
6 jobs: 7 jobs:
8 - tox-format
7 - tox-pep8 9 - tox-pep8
diff --git a/pyproject.toml b/pyproject.toml
new file mode 100644
index 0000000..55ec8d7
--- /dev/null
+++ b/pyproject.toml
@@ -0,0 +1,2 @@
1[tool.black]
2line-length = 120
diff --git a/setup.cfg b/setup.cfg
index 13d7089..2a8d1ea 100644
--- a/setup.cfg
+++ b/setup.cfg
@@ -53,3 +53,25 @@ universal = 1
53[pbr] 53[pbr]
54skip_authors = True 54skip_authors = True
55skip_changelog = True 55skip_changelog = True
56
57[flake8]
58# E123, E125 skipped as they are invalid PEP-8.
59# E741, short ambiguous variable names
60# H106 Don’t put vim configuration in source files
61# H203 Use assertIs(Not)None to check for None
62max-line-length = 120
63ignore = E123,E125,E741
64enable-extensions=H106,H203
65show-source = True
66exclude=.venv,.git,.tox,dist,doc,*lib/python*,*egg,build
67
68[isort]
69known_first_party = ara
70default_section = THIRDPARTY
71skip = build,.git,.tox,.cache,.venv
72not_skip = __init__.py
73multi_line_output=3
74include_trailing_comma=True
75force_grid_wrap=0
76combine_as_imports=True
77line_length=88
diff --git a/test-requirements.txt b/test-requirements.txt
index 97b7674..d6b4edf 100644
--- a/test-requirements.txt
+++ b/test-requirements.txt
@@ -3,3 +3,5 @@ coverage
3flake8 3flake8
4sphinx!=1.2.0,!=1.3b1,<1.3,>=1.1.2 4sphinx!=1.2.0,!=1.3b1,<1.3,>=1.1.2
5sphinx-rtd-theme 5sphinx-rtd-theme
6black==18.9b0 ; python_version >= '3.6' # Exact version for prerelease
7isort
diff --git a/tox.ini b/tox.ini
index f1d522b..c03eede 100644
--- a/tox.ini
+++ b/tox.ini
@@ -22,13 +22,7 @@ commands =
22 flake8 ara 22 flake8 ara
23 bandit -r ara 23 bandit -r ara
24 24
25[flake8] 25[testenv:format]
26# E123, E125 skipped as they are invalid PEP-8. 26commands =
27# E741, short ambiguous variable names 27 black --diff --check ara
28# H106 Don’t put vim configuration in source files 28 isort --recursive --check-only --diff --virtual-env {envdir} ara
29# H203 Use assertIs(Not)None to check for None
30max-line-length = 120
31ignore = E123,E125,E741
32enable-extensions=H106,H203
33show-source = True
34exclude=.venv,.git,.tox,dist,doc,*lib/python*,*egg,build