diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index dae17580..fefe85bf 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -7,7 +7,7 @@ on: pull_request: jobs: - black: + python: runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 @@ -18,6 +18,12 @@ jobs: with: files: "**/*.py" - - uses: psf/black@stable + - if: ${{ steps.changed-files.outputs.all_changed_files != '' }} + uses: psf/black@stable + with: + src: ${{ steps.changed-files.outputs.all_changed_files }} + + - if: ${{ steps.changed-files.outputs.all_changed_files != '' }} + uses: chartboost/ruff-action@v1 with: src: ${{ steps.changed-files.outputs.all_changed_files }} diff --git a/README.md b/README.md index ce32c493..1780b2fd 100644 --- a/README.md +++ b/README.md @@ -219,6 +219,7 @@ Any contribution is welcome and we only ask contributors to: * Provide *at least* integration tests for any contribution. * The Pull Request *MUST* contain a changelog fragment. See [Ansible documentation](https://docs.ansible.com/ansible/latest/community/development_process.html#creating-a-changelog-fragment) about fragments. * Create an issue for any significant contribution that would change a large portion of the code base. +* Use [ruff](https://github.com/astral-sh/ruff) to lint and [black](https://github.com/psf/black) to format your changes on python code. ## Contributors ✨ diff --git a/changelogs/fragments/341-lint-ruff.yml b/changelogs/fragments/341-lint-ruff.yml new file mode 100644 index 00000000..e5cfd5b4 --- /dev/null +++ b/changelogs/fragments/341-lint-ruff.yml @@ -0,0 +1,3 @@ +--- +trivial: + - added python ruff linting action