Skip to content

Commit 62f915b

Browse files
committed
Updated files with git_helper
1 parent 2a6ec1c commit 62f915b

File tree

3 files changed

+36
-28
lines changed

3 files changed

+36
-28
lines changed

doc-source/conf.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@
1515
from __pkginfo__ import __version__
1616

1717

18-
1918
github_url = f"https://github.com/domdfcoding/domdf_python_tools"
2019

2120
rst_prolog = f""".. |pkgname| replace:: domdf_python_tools

lint_roller.sh

Lines changed: 11 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -1,44 +1,29 @@
11
#!/bin/bash
22

3-
# TODO: single file packages
4-
53
# fix these
6-
declare -a errors=(
7-
E301 E302 E303 E304 E305 E306 E502 E265
8-
W291 W292 W293 W391 E226 E225 E241 E231
9-
)
4+
declare errors="E301 E302 E303 E304 E305 E306 E502 E265 W291 W292 W293 W391 E226 E225 E241 E231 "
105

116
# Only warn for these
12-
declare -a warnings=(
13-
E101 E111 E112 E113 E121 E122 E124 E125
14-
E127 E128 E129 E131 E133 E201 E202 E203
15-
E211 E222 E223 E224 E225 E227 E228
16-
E242 E251 E261 E262 E271 E272 E402
17-
E703 E711 E712 E713 E714 E721 W504
18-
)
7+
declare warnings="E101 E111 E112 E113 E121 E122 E124 E125 E127 E128 E129 E131 E133 E201 E202 E203 E211 E222 E223 E224 E225 E227 E228 E242 E251 E261 E262 E271 E272 E402 E703 E711 E712 E713 E714 E721 W504 "
198

209
if [ -z "$(git status --porcelain --untracked-files=no)" ] || [ "$1" == "-f" ]; then
2110
# Working directory clean
2211

23-
for error in "${errors[@]}"
24-
do
25-
echo "Correcting $error"
12+
echo "Running autopep8"
13+
14+
autopep8 --in-place --select "$errors" -a --recursive domdf_python_tools/
15+
>&2 flake8 --select "$errors" domdf_python_tools/
2616

27-
autopep8 --in-place --select "$error" -a --recursive domdf_python_tools/
28-
>&2 flake8 --select "$error" domdf_python_tools/
2917

30-
autopep8 --in-place --select "$error" -a --recursive tests/
31-
>&2 flake8 --select "$error" tests/
18+
autopep8 --in-place --select "$errors" -a --recursive tests/
19+
>&2 flake8 --select "$errors" tests/
3220

33-
done
3421

35-
for warning in "${warnings[@]}"; do
36-
echo "Searching for $warning"
22+
echo "Running flake8"
3723

38-
>&2 flake8 --select "$warning" domdf_python_tools/
24+
>&2 flake8 domdf_python_tools/
3925

40-
>&2 flake8 --select "$warning" tests/
41-
done
26+
>&2 flake8 tests/
4227

4328
exit 0
4429

tox.ini

Lines changed: 25 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
# This file must be in the same dir as setup.py
44
[tox]
5-
envlist = py36, py37, py38, pypy3,
5+
envlist = py36, py37, py38, pypy3, docs
66
skip_missing_interpreters = True
77
requires = pip >= 19.0.0
88

@@ -27,3 +27,27 @@ commands =
2727
python --version
2828
; Run tests
2929
python -m pytest --cov=domdf_python_tools tests/
30+
31+
[testenv:docs]
32+
basepython = python3.6
33+
skip_install = true
34+
deps = -r{toxinidir}/doc-source/requirements.txt
35+
commands = sphinx-build doc-source doc-source/build
36+
37+
[testenv:lint]
38+
basepython = python3.6
39+
skip_install = true
40+
deps =
41+
autopep8
42+
flake8
43+
commands =
44+
flake8 domdf_python_tools
45+
flake8 tests
46+
47+
48+
49+
50+
[flake8]
51+
max-line-length = 120
52+
select = E301 E302 E303 E304 E305 E306 E502 E265 W291 W292 W293 W391 E226 E225 E241 E231 E101 E111 E112 E113 E121 E122 E124 E125 E127 E128 E129 E131 E133 E201 E202 E203 E211 E222 E223 E224 E225 E227 E228 E242 E251 E261 E262 E271 E272 E402 E703 E711 E712 E713 E714 E721 W504
53+
exclude = .git,__pycache__,doc-source,old,build,dist,make_conda_recipe.py,__pkginfo__.py,setup.py

0 commit comments

Comments
 (0)