-
Notifications
You must be signed in to change notification settings - Fork 0
/
tox.ini
101 lines (88 loc) · 2.63 KB
/
tox.ini
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
# tox (https://tox.readthedocs.io/) is a tool for running tests
# in multiple virtualenvs. This configuration file will run the
# test suite on all supported python versions. To use it, "pip install tox"
# and then run "tox" from this directory.
[tox]
envlist = py36
[testenv]
commands =
python manage.py test {posargs}
# Test coverage
[testenv:coverage]
deps =
coverage
commands =
coverage run manage.py test
coverage report
# Test coverage with html report
[testenv:coverage-html]
deps =
{[testenv:coverage]deps}
commands =
{[testenv:coverage]commands}
coverage html
# Linters
[linters]
include_dirs = crashreports crashreport_stats hiccup
[testenv:flake8]
deps =
-rrequirements-dev-flake8.txt
commands =
flake8 {posargs: {[linters]include_dirs}}
[testenv:pylint]
deps =
-rrequirements-dev-pylint.txt
commands =
pylint {posargs: {[linters]include_dirs}}
[testenv:linters]
deps =
{[testenv:flake8]deps}
{[testenv:pylint]deps}
commands =
{[testenv:flake8]commands}
{[testenv:pylint]commands}
# Git pre-commit hooks: Run formatter and linters
[testenv:pre-commit-hooks]
deps =
-rrequirements-dev.txt
passenv = GIT_INDEX_FILE
commands =
{toxinidir}/tools/hooks/pre-commit.d/pre-commit-black.sh
python {toxinidir}/tools/hooks/pre-commit.d/pre-commit-flake8.py
{toxinidir}/tools/hooks/pre-commit.d/pre-commit-pylint.sh
# Flake8 configuration
[flake8]
format = ${cyan}%(path)s${reset}:${yellow_bold}%(row)d${reset}:${green_bold}%(col)d${reset}: ${red_bold}%(code)s${reset} %(text)s
max-complexity = 10
max-line-length = 80
# Documentation
# Shared commands for both docs options
[docs]
swagger_version = 1.3.3
commands =
python manage.py generate_swagger --overwrite documentation/hiccup-api.json
wget -nc https://jcenter.bintray.com/io/github/swagger2markup/swagger2markup-cli/{[docs]swagger_version}/swagger2markup-cli-{[docs]swagger_version}.jar
whitelist_externals=
java
wget
# Create markdown docs
[testenv:docs]
commands =
{[docs]commands}
java -jar swagger2markup-cli-{[docs]swagger_version}.jar convert \
-f documentation/api-endpoints \
-i documentation/hiccup-api.json \
-c documentation/swagger.properties
whitelist_externals = {[docs]whitelist_externals}
# Create HTML docs
[testenv:docs-html]
commands =
{[docs]commands}
java -jar swagger2markup-cli-{[docs]swagger_version}.jar convert \
-f documentation/api-endpoints \
-i documentation/hiccup-api.json \
-c documentation/swagger-asciidoc.properties
asciidoctor documentation/api-endpoints.adoc
whitelist_externals =
{[docs]whitelist_externals}
asciidoctor