Skip to content

Commit

Permalink
Change: Allow to specify python tool for format checks in lint action
Browse files Browse the repository at this point in the history
Black has a serious competitor in form of ruff format nowadays.
Therefore allow to specify the format checker in the python linting
workflow.
  • Loading branch information
bjoernricks committed Feb 3, 2025
1 parent e2d4d45 commit 21002a6
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions lint-python/action.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,9 @@ inputs:
linter:
description: "Linter to use. Default is 'ruff check'."
default: "ruff check"
formatter:
description: "Formatter to use. Default is 'black --check --diff'."
default: "black --check --diff"

branding:
icon: "package"
Expand All @@ -45,9 +48,9 @@ runs:
cache-poetry-installation: ${{ inputs.cache-poetry-installation }}
install-dependencies: ${{ inputs.install-dependencies }}
working-directory: ${{ inputs.working-directory }}
- run: poetry run black --check --diff ${{ inputs.packages }}
- run: poetry run ${{ inputs.formatter }} ${{ inputs.packages }}
shell: bash
name: Check with black
name: Check with ${{ inputs.formatter }}
working-directory: ${{ inputs.working-directory }}
- run: poetry run ${{ inputs.linter }} ${{ inputs.packages }}
shell: bash
Expand Down

0 comments on commit 21002a6

Please sign in to comment.