Merge pull request #1039 from YunoHost/impove-tox,-add-python3-linter

imove tox and add python3 linter
This commit is contained in:
Kayou 2020-08-17 23:55:35 +02:00 committed by GitHub
commit 03e84f9ebd
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 27 additions and 24 deletions

View file

@ -3,20 +3,36 @@
########################################
# later we must fix lint and format-check jobs and remove "allow_failure"
lint:
lint27:
stage: lint
image: "before-install"
needs: []
allow_failure: true
script:
- tox -e lint
- tox -e py27-lint
invalidcode:
lint37:
stage: lint
image: "before-install"
needs: []
allow_failure: true
script:
- tox -e py37-lint
invalidcode27:
stage: lint
image: "before-install"
needs: []
script:
- tox -e invalidcode
- tox -e py27-invalidcode
invalidcode37:
stage: lint
image: "before-install"
allow_failure: true
needs: []
script:
- tox -e py37-invalidcode
format-check:
stage: lint
@ -24,4 +40,4 @@ format-check:
needs: []
allow_failure: true
script:
- black --check --diff src doc data tests
- tox -e py37-black

25
tox.ini
View file

@ -1,25 +1,12 @@
[tox]
envlist =
py27
lint
skipdist = True
envlist = py{27,37}-{lint,invalidcode},py37-black
[testenv]
skip_install=True
deps =
pytest >= 4.6.3, < 5.0
pyyaml >= 5.1.2, < 6.0
flake8 >= 3.7.9, < 3.8
urllib3
py{27,37}-{lint,invalidcode}: flake8
py37-black: black
commands =
pytest {posargs}
[testenv:lint]
skip_install=True
commands = flake8 src doc data tests
deps = flake8
[testenv:invalidcode]
skip_install=True
commands = flake8 src data --exclude src/yunohost/tests --select F --ignore F401,F841
deps = flake8
py{27,37}-lint: flake8 src doc data tests
py{27,37}-invalidcode: flake8 src data --exclude src/yunohost/tests --select F --ignore F401,F841
py37-black: black --check --diff src doc data tests