0001-misc-use-isort-52224.patch
.pre-commit-config.yaml | ||
---|---|---|
6 | 6 |
hooks: |
7 | 7 |
- id: black |
8 | 8 |
args: ['--target-version', 'py37', '--skip-string-normalization', '--line-length', '110'] |
9 |
- repo: https://github.com/PyCQA/isort |
|
10 |
rev: 5.7.0 |
|
11 |
hooks: |
|
12 |
- id: isort |
|
13 |
args: ['--force-single-line-imports', '--line-length', '110'] |
Jenkinsfile | ||
---|---|---|
9 | 9 |
stage('Unit tests django 1.11') { |
10 | 10 |
agent any |
11 | 11 |
steps { |
12 |
sh 'tox -rv -e py3-django111-black-pylint-coverage' |
|
12 |
sh 'tox -rv -e py3-django111-black-isort-pylint-coverage'
|
|
13 | 13 |
} |
14 | 14 |
post { |
15 | 15 |
always { |
16 |
stash includes:'junit-py3-django111-black-pylint-coverage.xml', name: 'django111' |
|
16 |
stash includes:'junit-py3-django111-black-isort-pylint-coverage.xml', name: 'django111'
|
|
17 | 17 |
script { |
18 | 18 |
utils = new Utils() |
19 | 19 |
utils.publish_coverage('coverage.xml') |
README | ||
---|---|---|
39 | 39 | |
40 | 40 |
black --target-version py37 --skip-string-normalization --line-length 110 |
41 | 41 | |
42 |
isort is used to format the imports, using those parameter: |
|
43 | ||
44 |
isort --force-single-line-imports --line-length 110 |
|
45 | ||
42 | 46 |
There is .pre-commit-config.yaml to use pre-commit to automatically run black |
43 | 47 |
before commits. (execute `pre-commit install` to install the git hook.) |
44 | 48 |
tox.ini | ||
---|---|---|
1 | 1 |
[tox] |
2 | 2 |
toxworkdir = {env:TMPDIR:/tmp}/tox-{env:USER}/wcs/{env:BRANCH_NAME:main}/{env:EXECUTOR_NUMBER:} |
3 |
envlist = py3-django111-black-pylint-coverage, py3-django22 |
|
3 |
envlist = py3-django111-black-isort-pylint-coverage, py3-django22
|
|
4 | 4 | |
5 | 5 |
[testenv] |
6 | 6 |
sitepackages = true |
... | ... | |
47 | 47 |
py.test -v {env:COVERAGE:} --junitxml=junit-{envname}.xml {posargs:tests/} |
48 | 48 |
pylint: ./pylint.sh wcs/ |
49 | 49 |
black: pre-commit run black --all-files --show-diff-on-failure |
50 |
isort: pre-commit run isort --all-files --show-diff-on-failure |
|
50 |
- |