-
-
Notifications
You must be signed in to change notification settings - Fork 23
/
setup.cfg
161 lines (135 loc) · 4.18 KB
/
setup.cfg
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
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
[bumpversion]
current_version = 0.22.2
commit = False
tag = False
[bumpversion:file:src/nitpick/__init__.py]
search = __version__ = "{current_version}"
replace = __version__ = "{new_version}"
[bumpversion:file:pyproject.toml]
search = version = "{current_version}"
replace = version = "{new_version}"
[bumpversion:file:package.json]
search = "version": "{current_version}",
replace = "version": "{new_version}",
[bumpversion:file:docs/conf.py]
search = version = "{current_version}"
replace = version = "{new_version}"
[bumpversion:file:docs/targets.rst]
search = {current_version}
replace = {new_version}
[bumpversion:file:docs/installation_guide.rst]
search = {current_version}
replace = {new_version}
[bumpversion:file:nitpick-style.toml]
search = {current_version}
replace = {new_version}
[bumpversion:file:README.md]
search = {current_version}
replace = {new_version}
[flake8]
ignore = D107,D401,D202,D203,E203,E402,E501,W503
max-line-length = 120
exclude = docs,.tox,build
max-complexity = 10
inline-quotes = double
[isort]
line_length = 120
skip = docs,.tox,build
multi_line_output = 3
include_trailing_comma = True
force_grid_wrap = 0
combine_as_imports = True
known_first_party = tests,nitpick
known_third_party = _pytest,attr,click,dictdiffer,flake8,identify,jmespath,marshmallow,marshmallow_polyfield,more_itertools,pluggy,pytest,requests,responses,ruamel,slugify,sortedcontainers,testfixtures,toml
[mypy]
ignore_missing_imports = True
follow_imports = skip
strict_optional = True
warn_no_return = True
warn_redundant_casts = True
warn_unused_ignores = True
[tool:pytest]
addopts = -v
norecursedirs = .* build dist CVS _darcs {arch} *.egg venv var docs
[tox:tox]
# https://tox.readthedocs.io/en/latest/example/package.html#poetry
isolated_build = True
# https://tox.readthedocs.io/en/latest/plugins.html
# https://tox.readthedocs.io/en/latest/config.html#conf-requires
# https://tox.readthedocs.io/en/latest/example/basic.html#tox-auto-provisioning
requires =
tox-travis
tox-venv
tox-pyenv
envlist = clean,lint,py39,py38,py37,py36,py35,report
[testenv]
description = Run tests with pytest and coverage
deps = pytest-cov
extras = test
depends =
{py39,py38,py37,py36,py35}: clean
report: py39,py38,py37,py36,py35
setenv =
# I had this error locally, but it worked on Travis CI: https://github.com/pytest-dev/pytest/issues/2042
PY_IGNORE_IMPORTMISMATCH = 1
commands =
# https://pytest-cov.readthedocs.io/en/latest/config.html
python -m pytest --cov-config=setup.cfg --cov --cov-append --cov-report=term-missing --doctest-modules {posargs:-vv}
# https://pytest-cov.readthedocs.io/en/latest/tox.html
[testenv:clean]
description = Erase data for the coverage report before running tests
skip_install = true
deps = coverage
commands = coverage erase
# https://tox.readthedocs.io/en/latest/config.html
[testenv:lint]
description = Lint all files with pre-commit
basepython = python3.7
platform = linux|darwin
# These packages are needed for the pylint hook to check the code under tests/*.
extras =
lint
test
deps =
pre-commit
safety
commands =
pre-commit run --all-files
safety check
[testenv:report]
description = Coverage report
skip_install = true
deps = coverage
commands =
coverage report
coverage html
[coverage:run]
# https://coverage.readthedocs.io/en/coverage-5.1/config.html#run
branch = true
parallel = true
omit =
tests/*
.tox/*
/home/travis/virtualenv/*
[coverage:paths]
# https://coverage.readthedocs.io/en/coverage-5.1/config.html#paths
source = src/
[coverage:report]
# https://coverage.readthedocs.io/en/coverage-5.1/config.html#report
show_missing = true
precision = 2
skip_covered = true
skip_empty = true
sort = Cover
[testenv:docs]
description = Build the HTML docs using Sphinx (sphinx-build, API docs, link checks)
basepython = python3.7
extras = doc
commands =
sphinx-apidoc --force --module-first --separate --implicit-namespaces --output-dir docs/source src/nitpick/
python3 docs/generate_rst.py
# Detect broken links on the documentation
sphinx-build --color -b linkcheck docs "{toxworkdir}/docs_out"
sphinx-build -d "{toxworkdir}/docs_doctree" --color -b html docs "{toxworkdir}/docs_out" {posargs}
[bandit]
exclude = tests/*