Loading README.md +9 −0 Original line number Diff line number Diff line Loading @@ -274,6 +274,15 @@ This job **disabled by default** and runs [black](https://black.readthedocs.io) | ---------------- | ----------------------------------------------------------------------- | ----------------- | | `black-enabled` / `PYTHON_BLACK_ENABLED` | Set to `true` to enable black job | _none_ (disabled) | ### `py-isort` job This job **disabled by default** and runs [isort](https://pycqa.github.io/isort/) on the repo. It is bound to the build stage. | Input / Variable | Description | Default value | | ---------------- | ----------------------------------------------------------------------- | ----------------- | | `isort-enabled` / `PYTHON_ISORT_ENABLED` | Set to `true` to enable isort job | _none_ (disabled) | ### SonarQube analysis If you're using the SonarQube template to analyse your Python code, here is a sample `sonar-project.properties` file: Loading kicker.json +6 −0 Original line number Diff line number Diff line Loading @@ -246,6 +246,12 @@ "name": "black", "description": "Code formatting based on [black](https://black.readthedocs.io)", "enable_with": "PYTHON_BLACK_ENABLED" }, { "id": "isort", "name": "isort", "description": "Check imports order with [isort](https://pycqa.github.io/isort)", "enable_with": "PYTHON_ISORT_ENABLED" } ], "variants": [ Loading templates/gitlab-ci-python.yml +18 −0 Original line number Diff line number Diff line Loading @@ -151,6 +151,10 @@ spec: description: Enable black type: boolean default: false isort-enabled: description: Enable isort type: boolean default: false --- # default workflow rules: Merge Request pipelines workflow: Loading Loading @@ -265,6 +269,7 @@ variables: PYTHON_RELEASE_ENABLED: $[[ inputs.release-enabled ]] PYTHON_BLACK_ENABLED: $[[ inputs.black-enabled ]] PYTHON_ISORT_ENABLED: $[[ inputs.isort-enabled ]] .python-scripts: &python-scripts | Loading Loading @@ -879,6 +884,19 @@ py-black: when: never - !reference [.test-policy, rules] py-isort: extends: .python-base stage: build script: - install_requirements - _pip install isort - _run isort . --check-only rules: # exclude if $PYTHON_ISORT_ENABLED not set - if: '$PYTHON_ISORT_ENABLED != "true"' when: never - !reference [.test-policy, rules] ############################################################################################### # test stage # ############################################################################################### Loading Loading
README.md +9 −0 Original line number Diff line number Diff line Loading @@ -274,6 +274,15 @@ This job **disabled by default** and runs [black](https://black.readthedocs.io) | ---------------- | ----------------------------------------------------------------------- | ----------------- | | `black-enabled` / `PYTHON_BLACK_ENABLED` | Set to `true` to enable black job | _none_ (disabled) | ### `py-isort` job This job **disabled by default** and runs [isort](https://pycqa.github.io/isort/) on the repo. It is bound to the build stage. | Input / Variable | Description | Default value | | ---------------- | ----------------------------------------------------------------------- | ----------------- | | `isort-enabled` / `PYTHON_ISORT_ENABLED` | Set to `true` to enable isort job | _none_ (disabled) | ### SonarQube analysis If you're using the SonarQube template to analyse your Python code, here is a sample `sonar-project.properties` file: Loading
kicker.json +6 −0 Original line number Diff line number Diff line Loading @@ -246,6 +246,12 @@ "name": "black", "description": "Code formatting based on [black](https://black.readthedocs.io)", "enable_with": "PYTHON_BLACK_ENABLED" }, { "id": "isort", "name": "isort", "description": "Check imports order with [isort](https://pycqa.github.io/isort)", "enable_with": "PYTHON_ISORT_ENABLED" } ], "variants": [ Loading
templates/gitlab-ci-python.yml +18 −0 Original line number Diff line number Diff line Loading @@ -151,6 +151,10 @@ spec: description: Enable black type: boolean default: false isort-enabled: description: Enable isort type: boolean default: false --- # default workflow rules: Merge Request pipelines workflow: Loading Loading @@ -265,6 +269,7 @@ variables: PYTHON_RELEASE_ENABLED: $[[ inputs.release-enabled ]] PYTHON_BLACK_ENABLED: $[[ inputs.black-enabled ]] PYTHON_ISORT_ENABLED: $[[ inputs.isort-enabled ]] .python-scripts: &python-scripts | Loading Loading @@ -879,6 +884,19 @@ py-black: when: never - !reference [.test-policy, rules] py-isort: extends: .python-base stage: build script: - install_requirements - _pip install isort - _run isort . --check-only rules: # exclude if $PYTHON_ISORT_ENABLED not set - if: '$PYTHON_ISORT_ENABLED != "true"' when: never - !reference [.test-policy, rules] ############################################################################################### # test stage # ############################################################################################### Loading