Loading README.md +1 −0 Original line number Diff line number Diff line Loading @@ -363,6 +363,7 @@ This job **disabled by default** and runs [Ruff](https://docs.astral.sh/ruff/) o | ---------------- | ----------------------------------------------------------------------- | ----------------- | | `ruff-enabled` / `RUFF_ENABLED` | Set to `true` to enable ruff job | _none_ (disabled) | | `ruff-args` / `RUFF_ARGS` | Additional [Ruff Linter CLI options](https://docs.astral.sh/ruff/configuration/#full-command-line-interface) | _none_ | | `ruff-files` / `RUFF_FILES` | Files or directories to analyse | . | :warning: Ruff can replace isort, Bandit, Pylint and much more. [More info](https://github.com/astral-sh/ruff/blob/main/docs/faq.md#which-tools-does-ruff-replace). Loading kicker.json +6 −0 Original line number Diff line number Diff line Loading @@ -312,6 +312,12 @@ "name": "RUFF_ARGS", "description": "Additional [Ruff Linter CLI options](https://docs.astral.sh/ruff/configuration/#full-command-line-interface)", "advanced": true }, { "name": "RUFF_FILES", "description": "Files or directories to analyse", "default": ".", "advanced": true } ] }, Loading templates/gitlab-ci-python.yml +7 −3 Original line number Diff line number Diff line Loading @@ -195,6 +195,9 @@ spec: ruff-args: description: Additional [Ruff Linter CLI options](https://docs.astral.sh/ruff/configuration/#full-command-line-interface) default: "" ruff-files: description: Files or directories to analyse default: '.' ruff-format-enabled: description: Enable Ruff type: boolean Loading Loading @@ -366,6 +369,7 @@ variables: PYTHON_ISORT_FILES: $[[ inputs.isort-files ]] RUFF_ENABLED: $[[ inputs.ruff-enabled ]] RUFF_ARGS: $[[ inputs.ruff-args ]] RUFF_FILES: $[[ inputs.ruff-files ]] RUFF_FORMAT_ENABLED: $[[ inputs.ruff-format-enabled ]] MYPY_ENABLED: $[[ inputs.mypy-enabled ]] MYPY_ARGS: $[[ inputs.mypy-args ]] Loading Loading @@ -1336,10 +1340,10 @@ py-ruff: - | if [[ "$SONAR_HOST_URL" ]] then ruff check . ${RUFF_ARGS} --extend-exclude .venv,.cache --exit-zero --output-format json --output-file reports/py-ruff.native.json ruff check ${RUFF_FILES} ${RUFF_ARGS} --extend-exclude .venv,.cache --exit-zero --output-format json --output-file reports/py-ruff.native.json fi # then GitLab and grouped/console formats - ruff check . ${RUFF_ARGS} --extend-exclude .venv,.cache --output-format gitlab --output-file reports/py-ruff.gitlab.json || ruff check . ${RUFF_ARGS} --extend-exclude .venv,.cache --output-format grouped - ruff check ${RUFF_FILES} ${RUFF_ARGS} --extend-exclude .venv,.cache --output-format gitlab --output-file reports/py-ruff.gitlab.json || ruff check ${RUFF_FILES} ${RUFF_ARGS} --extend-exclude .venv,.cache --output-format grouped artifacts: name: "$CI_JOB_NAME artifacts from $CI_PROJECT_NAME on $CI_COMMIT_REF_SLUG" expire_in: 1 day Loading @@ -1364,7 +1368,7 @@ py-ruff-format: fi # Ruff is self dependent tool (written in Rust), it can be installed without project dependencies (_pip and _run don't look required here) - pip install ${PIP_OPTS} ruff - ruff format --check . --exclude .venv,.cache - ruff format --check ${RUFF_FILES} --exclude .venv,.cache rules: # exclude if $RUFF_FORMAT_ENABLED not set - if: '$RUFF_FORMAT_ENABLED != "true"' Loading Loading
README.md +1 −0 Original line number Diff line number Diff line Loading @@ -363,6 +363,7 @@ This job **disabled by default** and runs [Ruff](https://docs.astral.sh/ruff/) o | ---------------- | ----------------------------------------------------------------------- | ----------------- | | `ruff-enabled` / `RUFF_ENABLED` | Set to `true` to enable ruff job | _none_ (disabled) | | `ruff-args` / `RUFF_ARGS` | Additional [Ruff Linter CLI options](https://docs.astral.sh/ruff/configuration/#full-command-line-interface) | _none_ | | `ruff-files` / `RUFF_FILES` | Files or directories to analyse | . | :warning: Ruff can replace isort, Bandit, Pylint and much more. [More info](https://github.com/astral-sh/ruff/blob/main/docs/faq.md#which-tools-does-ruff-replace). Loading
kicker.json +6 −0 Original line number Diff line number Diff line Loading @@ -312,6 +312,12 @@ "name": "RUFF_ARGS", "description": "Additional [Ruff Linter CLI options](https://docs.astral.sh/ruff/configuration/#full-command-line-interface)", "advanced": true }, { "name": "RUFF_FILES", "description": "Files or directories to analyse", "default": ".", "advanced": true } ] }, Loading
templates/gitlab-ci-python.yml +7 −3 Original line number Diff line number Diff line Loading @@ -195,6 +195,9 @@ spec: ruff-args: description: Additional [Ruff Linter CLI options](https://docs.astral.sh/ruff/configuration/#full-command-line-interface) default: "" ruff-files: description: Files or directories to analyse default: '.' ruff-format-enabled: description: Enable Ruff type: boolean Loading Loading @@ -366,6 +369,7 @@ variables: PYTHON_ISORT_FILES: $[[ inputs.isort-files ]] RUFF_ENABLED: $[[ inputs.ruff-enabled ]] RUFF_ARGS: $[[ inputs.ruff-args ]] RUFF_FILES: $[[ inputs.ruff-files ]] RUFF_FORMAT_ENABLED: $[[ inputs.ruff-format-enabled ]] MYPY_ENABLED: $[[ inputs.mypy-enabled ]] MYPY_ARGS: $[[ inputs.mypy-args ]] Loading Loading @@ -1336,10 +1340,10 @@ py-ruff: - | if [[ "$SONAR_HOST_URL" ]] then ruff check . ${RUFF_ARGS} --extend-exclude .venv,.cache --exit-zero --output-format json --output-file reports/py-ruff.native.json ruff check ${RUFF_FILES} ${RUFF_ARGS} --extend-exclude .venv,.cache --exit-zero --output-format json --output-file reports/py-ruff.native.json fi # then GitLab and grouped/console formats - ruff check . ${RUFF_ARGS} --extend-exclude .venv,.cache --output-format gitlab --output-file reports/py-ruff.gitlab.json || ruff check . ${RUFF_ARGS} --extend-exclude .venv,.cache --output-format grouped - ruff check ${RUFF_FILES} ${RUFF_ARGS} --extend-exclude .venv,.cache --output-format gitlab --output-file reports/py-ruff.gitlab.json || ruff check ${RUFF_FILES} ${RUFF_ARGS} --extend-exclude .venv,.cache --output-format grouped artifacts: name: "$CI_JOB_NAME artifacts from $CI_PROJECT_NAME on $CI_COMMIT_REF_SLUG" expire_in: 1 day Loading @@ -1364,7 +1368,7 @@ py-ruff-format: fi # Ruff is self dependent tool (written in Rust), it can be installed without project dependencies (_pip and _run don't look required here) - pip install ${PIP_OPTS} ruff - ruff format --check . --exclude .venv,.cache - ruff format --check ${RUFF_FILES} --exclude .venv,.cache rules: # exclude if $RUFF_FORMAT_ENABLED not set - if: '$RUFF_FORMAT_ENABLED != "true"' Loading