Commit dccee013 authored by Guilhem Bonnefille's avatar Guilhem Bonnefille
Browse files

fix: remove uneeded argument

`ruff check` can run without the `.` parameter, so this argument isn’t really necessary.
If someone wants to customize the behavior, they can use `ruff-args`.
parent 7b163bb4
Loading
Loading
Loading
Loading
+0 −1
Original line number Diff line number Diff line
@@ -363,7 +363,6 @@ 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).

+0 −6
Original line number Diff line number Diff line
@@ -312,12 +312,6 @@
          "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
        }
      ]
    },
+3 −7
Original line number Diff line number Diff line
@@ -195,9 +195,6 @@ 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
@@ -369,7 +366,6 @@ variables:
  PYTHON_ISORT_ARGS: $[[ inputs.isort-args ]]
  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 ]]
@@ -1340,10 +1336,10 @@ py-ruff:
    - |
      if [[ "$SONAR_HOST_URL" ]]
      then
        ruff check ${RUFF_FILES} ${RUFF_ARGS} --extend-exclude .venv,.cache --exit-zero --output-format json --output-file reports/py-ruff.native.json
        ruff check ${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_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
    - 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
  artifacts:
    name: "$CI_JOB_NAME artifacts from $CI_PROJECT_NAME on $CI_COMMIT_REF_SLUG"
    expire_in: 1 day
@@ -1368,7 +1364,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 ${RUFF_FILES} --exclude .venv,.cache
    - ruff format --check --exclude .venv,.cache
  rules:
    # exclude if $RUFF_FORMAT_ENABLED not set
    - if: '$RUFF_FORMAT_ENABLED != "true"'