From a63011b3f62d8de15cb27c0af0ccd46edbd2cfc4 Mon Sep 17 00:00:00 2001 From: jvoisin Date: Mon, 20 Feb 2023 20:00:14 +0100 Subject: [PATCH] Improve the CI - Remove some useless linters - Make use of ruff --- .gitlab-ci.yml | 29 +++++++---------------------- pyproject.toml | 9 +++++++++ 2 files changed, 16 insertions(+), 22 deletions(-) create mode 100644 pyproject.toml 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 @@ -include: - - template: Security/SAST.gitlab-ci.yml - variables: 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 - useradd --home-dir ${CI_PROJECT_DIR} 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: - image: $CONTAINER_REGISTRY:linting +linting:ruff: 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 + - 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: 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 @@ +[project] +name = "mat" +readme = "README.md" +requires-python = ">=3.9" + +[tool.ruff] +target-version = "py39" +# E501 Line too long +ignore = ["E501", "F401", "E402", "E722"]