Add linter

This commit is contained in:
Kay0u 2020-04-30 20:10:20 +02:00
parent c33e61ab2e
commit d6095a3c0f
No known key found for this signature in database
GPG key ID: AE1DCADB6415A156

View file

@ -1,9 +1,25 @@
stages:
- postinstall
- tests
- lint
.tests:
########################################
# POSTINSTALL
########################################
postinstall:
image: before-postinstall
stage: postinstall
script:
- yunohost tools postinstall -d domain.tld -p the_password --ignore-dyndns
########################################
# TESTS
########################################
.test-stage:
image: after-postinstall
stage: tests
before_script:
- apt-get install python-pip -y
- mkdir -p .pip
@ -25,77 +41,90 @@ stages:
- src/yunohost/tests/apps
key: "$CI_JOB_STAGE-$CI_COMMIT_REF_SLUG"
postinstall:
image: before-postinstall
stage: postinstall
script:
- yunohost tools postinstall -d domain.tld -p the_password --ignore-dyndns
root-tests:
extends: .tests
stage: tests
extends: .test-stage
script:
- py.test tests
test-apps:
extends: .tests
stage: tests
extends: .test-stage
script:
- cd src/yunohost
- py.test tests/test_apps.py
test-appscatalog:
extends: .tests
stage: tests
extends: .test-stage
script:
- cd src/yunohost
- py.test tests/test_appscatalog.py
test-appurl:
extends: .tests
stage: tests
extends: .test-stage
script:
- cd src/yunohost
- py.test tests/test_appurl.py
test-backuprestore:
extends: .tests
stage: tests
extends: .test-stage
script:
- cd src/yunohost
- py.test tests/test_backuprestore.py
test-changeurl:
extends: .tests
stage: tests
extends: .test-stage
script:
- cd src/yunohost
- py.test tests/test_changeurl.py
test-permission:
extends: .tests
stage: tests
extends: .test-stage
script:
- cd src/yunohost
- py.test tests/test_permission.py
test-settings:
extends: .tests
stage: tests
extends: .test-stage
script:
- cd src/yunohost
- py.test tests/test_settings.py
test-user-group:
extends: .tests
stage: tests
extends: .test-stage
script:
- cd src/yunohost
- py.test tests/test_user-group.py
test-regenconf:
extends: .tests
stage: tests
extends: .test-stage
script:
- cd src/yunohost
- py.test tests/test_regenconf.py
########################################
# LINTER
########################################
.lint-stage:
image: before-postinstall
stage: lint
before_script:
- apt-get install python-pip -y
- mkdir -p .pip
- pip install -U pip
- hash -d pip
- pip --cache-dir=.pip install flake8 blake
cache:
paths:
- .pip
- src/yunohost/tests/apps
key: "$CI_JOB_STAGE-$CI_COMMIT_REF_SLUG"
lint:
extends: .lint-stage
script:
- flake8 src tests data
format-check:
extends: .lint-stage
script:
- black {posargs:--check --diff} src tests data