Improve the CI
- Remove some useless linters - Make use of ruff
This commit is contained in:
parent
e41390eb64
commit
a63011b3f6
@ -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
|
||||||
|
|
||||||
@ -12,28 +9,16 @@ stages:
|
|||||||
before_script: # This is needed to not run the testsuite as root
|
before_script: # This is needed to not run the testsuite as root
|
||||||
- useradd --home-dir ${CI_PROJECT_DIR} mat2
|
- useradd --home-dir ${CI_PROJECT_DIR} mat2
|
||||||
- chown -R mat2 .
|
- chown -R mat2 .
|
||||||
|
|
||||||
linting:bandit:
|
|
||||||
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
|
|
||||||
script:
|
|
||||||
# Run codespell to check for spelling errors; ignore errors about binary
|
|
||||||
# files, use a config with ignored words and exclude the git directory,
|
|
||||||
# which might contain false positives
|
|
||||||
- codespell -q 2 -I utils/ci/codespell/ignored_words.txt -S .git
|
|
||||||
|
|
||||||
linting:pylint:
|
linting:ruff:
|
||||||
image: $CONTAINER_REGISTRY:linting
|
|
||||||
stage: linting
|
stage: linting
|
||||||
script:
|
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
|
- apt update
|
||||||
|
- apt install -qqy --no-install-recommends python3-venv
|
||||||
|
- python3 -m venv venv
|
||||||
|
- source venv/bin/activate
|
||||||
|
- pip3 install ruff
|
||||||
|
- ruff check .
|
||||||
|
|
||||||
linting:mypy:
|
linting:mypy:
|
||||||
image: $CONTAINER_REGISTRY:linting
|
image: $CONTAINER_REGISTRY:linting
|
||||||
|
9
pyproject.toml
Normal file
9
pyproject.toml
Normal 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"]
|
Loading…
Reference in New Issue
Block a user