summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorjvoisin2023-02-20 20:00:14 +0100
committerjvoisin2023-02-20 21:15:07 +0100
commita63011b3f62d8de15cb27c0af0ccd46edbd2cfc4 (patch)
tree2adea1728d3eead90b630f1089b71b3fdf24993a
parente41390eb64eaf72fd1b9914221eaf22801812521 (diff)
Improve the CI
- Remove some useless linters - Make use of ruff
-rw-r--r--.gitlab-ci.yml29
-rw-r--r--pyproject.toml9
2 files changed, 16 insertions, 22 deletions
diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
index 098e3cb..310cbbe 100644
--- a/.gitlab-ci.yml
+++ b/.gitlab-ci.yml
@@ -1,6 +1,3 @@
1include:
2 - template: Security/SAST.gitlab-ci.yml
3
4variables: 1variables:
5 CONTAINER_REGISTRY: $CI_REGISTRY/georg/mat2-ci-images 2 CONTAINER_REGISTRY: $CI_REGISTRY/georg/mat2-ci-images
6 3
@@ -12,28 +9,16 @@ stages:
12 before_script: # This is needed to not run the testsuite as root 9 before_script: # This is needed to not run the testsuite as root
13 - useradd --home-dir ${CI_PROJECT_DIR} mat2 10 - useradd --home-dir ${CI_PROJECT_DIR} mat2
14 - chown -R mat2 . 11 - chown -R mat2 .
15
16linting:bandit:
17 image: $CONTAINER_REGISTRY:linting
18 stage: linting
19 script: # TODO: remove B405 and B314
20 - bandit ./mat2 --format txt --skip B101
21 - bandit -r ./libmat2 --format txt --skip B101,B404,B603,B405,B314,B108,B311
22
23linting:codespell:
24 image: $CONTAINER_REGISTRY:linting
25 stage: linting
26 script:
27 # Run codespell to check for spelling errors; ignore errors about binary
28 # files, use a config with ignored words and exclude the git directory,
29 # which might contain false positives
30 - codespell -q 2 -I utils/ci/codespell/ignored_words.txt -S .git
31 12
32linting:pylint: 13linting:ruff:
33 image: $CONTAINER_REGISTRY:linting
34 stage: linting 14 stage: linting
35 script: 15 script:
36 - 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 16 - apt update
17 - apt install -qqy --no-install-recommends python3-venv
18 - python3 -m venv venv
19 - source venv/bin/activate
20 - pip3 install ruff
21 - ruff check .
37 22
38linting:mypy: 23linting:mypy:
39 image: $CONTAINER_REGISTRY:linting 24 image: $CONTAINER_REGISTRY:linting
diff --git a/pyproject.toml b/pyproject.toml
new file mode 100644
index 0000000..0125edf
--- /dev/null
+++ b/pyproject.toml
@@ -0,0 +1,9 @@
1[project]
2name = "mat"
3readme = "README.md"
4requires-python = ">=3.9"
5
6[tool.ruff]
7target-version = "py39"
8# E501 Line too long
9ignore = ["E501", "F401", "E402", "E722"]