1
0
mirror of synced 2024-11-22 01:04:23 +01:00

Improve the CI

- Remove some useless linters
- Make use of ruff
This commit is contained in:
jvoisin 2023-02-20 20:00:14 +01:00
parent e41390eb64
commit a63011b3f6
2 changed files with 16 additions and 22 deletions

View File

@ -1,6 +1,3 @@
include:
- template: Security/SAST.gitlab-ci.yml
variables: variables:
CONTAINER_REGISTRY: $CI_REGISTRY/georg/mat2-ci-images CONTAINER_REGISTRY: $CI_REGISTRY/georg/mat2-ci-images
@ -13,27 +10,15 @@ stages:
- useradd --home-dir ${CI_PROJECT_DIR} mat2 - useradd --home-dir ${CI_PROJECT_DIR} mat2
- chown -R mat2 . - chown -R mat2 .
linting:bandit: linting:ruff:
image: $CONTAINER_REGISTRY:linting
stage: linting
script: # TODO: remove B405 and B314
- bandit ./mat2 --format txt --skip B101
- bandit -r ./libmat2 --format txt --skip B101,B404,B603,B405,B314,B108,B311
linting:codespell:
image: $CONTAINER_REGISTRY:linting
stage: linting stage: linting
script: script:
# Run codespell to check for spelling errors; ignore errors about binary - apt update
# files, use a config with ignored words and exclude the git directory, - apt install -qqy --no-install-recommends python3-venv
# which might contain false positives - python3 -m venv venv
- codespell -q 2 -I utils/ci/codespell/ignored_words.txt -S .git - source venv/bin/activate
- pip3 install ruff
linting:pylint: - ruff check .
image: $CONTAINER_REGISTRY:linting
stage: linting
script:
- pylint --disable=no-else-return,no-else-raise,no-else-continue,unnecessary-comprehension,raise-missing-from,unsubscriptable-object,use-dict-literal,unspecified-encoding,consider-using-f-string,use-list-literal,too-many-statements --extension-pkg-whitelist=cairo,gi ./libmat2 ./mat2
linting:mypy: linting:mypy:
image: $CONTAINER_REGISTRY:linting image: $CONTAINER_REGISTRY:linting

9
pyproject.toml Normal file
View File

@ -0,0 +1,9 @@
[project]
name = "mat"
readme = "README.md"
requires-python = ">=3.9"
[tool.ruff]
target-version = "py39"
# E501 Line too long
ignore = ["E501", "F401", "E402", "E722"]