Merge remote-tracking branch 'origin/add-black' into dev

This commit is contained in:
Alexandre Aubin 2020-08-18 19:05:51 +02:00
commit a891d20a17
3 changed files with 43 additions and 31 deletions

View file

@ -1,24 +1,43 @@
######################################## ########################################
# LINTER # LINTER
######################################## ########################################
# later we must fix lint and format-check jobs and remove "allow_failure"
lint: lint27:
stage: lint stage: lint
image: "before-install" image: "before-install"
needs: [] needs: []
allow_failure: true allow_failure: true
script: 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 stage: lint
image: "before-install" image: "before-install"
needs: [] needs: []
script: script:
- tox -e invalidcode - tox -e py27-invalidcode
# Disabled, waiting for buster invalidcode37:
#format-check: stage: lint
# extends: .lint-stage image: "before-install"
# script: allow_failure: true
# - black --check --diff needs: []
script:
- tox -e py37-invalidcode
format-check:
stage: lint
image: "before-install"
needs: []
allow_failure: true
script:
- tox -e py37-black

View file

@ -2,12 +2,18 @@ language: python
matrix: matrix:
allow_failures: allow_failures:
- env: TOXENV=lint - env: TOXENV=py27-lint
- env: TOXENV=py37-lint
- env: TOXENV=py37-invalidcode
include: include:
- python: 2.7 - python: 2.7
env: TOXENV=py27 env: TOXENV=py27-lint
- python: 2.7 - python: 2.7
env: TOXENV=lint env: TOXENV=py27-invalidcode
- python: 3.7
env: TOXENV=py37-lint
- python: 3.7
env: TOXENV=py37-invalidcode
install: install:
- pip install tox - pip install tox

25
tox.ini
View file

@ -1,25 +1,12 @@
[tox] [tox]
envlist = envlist = py{27,37}-{lint,invalidcode},py37-black
py27
lint
skipdist = True
[testenv] [testenv]
skip_install=True skip_install=True
deps = deps =
pytest >= 4.6.3, < 5.0 py{27,37}-{lint,invalidcode}: flake8
pyyaml >= 5.1.2, < 6.0 py37-black: black
flake8 >= 3.7.9, < 3.8
urllib3
commands = commands =
pytest {posargs} 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
[testenv:lint] py37-black: black --check --diff src doc data tests
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