Commit 92fa5aef authored by Guilhem Bonnefille's avatar Guilhem Bonnefille Committed by Pierre Smeyers
Browse files

fix(black): let's configure the files to analyse

parent a88294c4
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -344,6 +344,7 @@ This job **disabled by default** and runs [black](https://black.readthedocs.io)
| Input / Variable | Description                                                             | Default value     |
| ---------------- | ----------------------------------------------------------------------- | ----------------- |
| `black-enabled` / `PYTHON_BLACK_ENABLED` | Set to `true` to enable black job               | _none_ (disabled) |
| `black-files` / `PYTHON_BLACK_FILES`     | Files or directories to analyse           | .                 |

### `py-isort` job

+9 −1
Original line number Diff line number Diff line
@@ -277,7 +277,15 @@
      "id": "black",
      "name": "black",
      "description": "Code formatting based on [black](https://black.readthedocs.io)",
      "enable_with": "PYTHON_BLACK_ENABLED"
      "enable_with": "PYTHON_BLACK_ENABLED",
      "variables": [
        {
          "name": "PYTHON_BLACK_FILES",
          "description": "Files or directories to analyse",
          "default": ".",
          "advanced": true
        }
      ]
    },
    {
      "id": "isort",
+5 −1
Original line number Diff line number Diff line
@@ -178,6 +178,9 @@ spec:
      description: Enable black
      type: boolean
      default: false
    black-files:
      description: Files or directories to analyse
      default: '.'
    isort-enabled:
      description: Enable isort
      type: boolean
@@ -355,6 +358,7 @@ variables:
  PYTHON_AUTO_RELEASE_ENABLED: $[[ inputs.auto-release-enabled ]]

  PYTHON_BLACK_ENABLED: $[[ inputs.black-enabled ]]
  PYTHON_BLACK_FILES: $[[ inputs.black-files ]]
  PYTHON_ISORT_ENABLED: $[[ inputs.isort-enabled ]]
  RUFF_ENABLED: $[[ inputs.ruff-enabled ]]
  RUFF_ARGS: $[[ inputs.ruff-args ]]
@@ -1293,7 +1297,7 @@ py-black:
  script:
    - install_requirements
    - _pip install black
    - _run black . --check --extend-exclude '(\/\.cache\/|\/\.venv\/)'
    - _run black ${PYTHON_BLACK_FILES} --check --extend-exclude '(\/\.cache\/|\/\.venv\/)'
  rules:
    # exclude if $PYTHON_BLACK_ENABLED not set
    - if: '$PYTHON_BLACK_ENABLED != "true"'