Skip to content

Commit

Permalink
CI(ruff): Fine tune posting Ruff suggestions (OSGeo#3978)
Browse files Browse the repository at this point in the history
* CI(ruff): Fix typo in ruff suggestions

* CI(ruff): Upload suggestions even if not all linting errors were fixed

* CI(ruff): Try suggesting more changes

* CI(ruff): Upload suggestions even if not all linting errors were fixed but do not run when cancelled
  • Loading branch information
echoix authored and a0x8o committed Jul 23, 2024
1 parent 28514e3 commit 57856bc
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/post-pr-reviews.yml
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ jobs:
CI_REPO_NAME: ${{ github.event.workflow_run.repository.name }}
# CI_PULL_REQUEST: "" # Populated from reviewdog's "-guess" flag since hard to get
- name: Post Ruff suggestions
if: ${{ steps.tools.outputs.black == 'true' }}
if: ${{ steps.tools.outputs.ruff == 'true' }}
run: |
TMPFILE="diff-${INPUT_TOOL_NAME}.patch"
GITHUB_ACTIONS="" reviewdog \
Expand Down
4 changes: 3 additions & 1 deletion .github/workflows/python-code-quality.yml
Original file line number Diff line number Diff line change
Expand Up @@ -67,10 +67,12 @@ jobs:
- name: Install Ruff
run: pip install ruff==${{ env.RUFF_VERSION }}
- name: Run Ruff
run: ruff check --output-format=github . --preview --fix
run: ruff check --output-format=github . --preview --fix --unsafe-fixes
- name: Create and uploads code suggestions to apply for Ruff
# Will fail fast here if there are changes required
id: diff-ruff
# To run after ruff step exits with failure when rules don't have fixes available
if: ${{ !cancelled() }}
uses: ./.github/actions/create-upload-suggestions
with:
tool-name: ruff
Expand Down

0 comments on commit 57856bc

Please sign in to comment.