Skip to content

Commit

Permalink
allow ruff to fail the build if errors are detected
Browse files Browse the repository at this point in the history
  • Loading branch information
AdamYoblick committed Sep 19, 2023
1 parent 9cc65eb commit 131afb5
Showing 1 changed file with 1 addition and 5 deletions.
6 changes: 1 addition & 5 deletions azure-pipelines/pipelines.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -38,13 +38,9 @@ jobs:
# See https://github.com/astral-sh/ruff and https://beta.ruff.rs/docs/
- script: "python3 -m pip install -U ruff"
displayName: "Install ruff"

# We just switched to a new linter and there are a ton of errors. We need time to go through them, but we don't want the block the build.
# Therefore, we use continueOnError to generate a warning while there are linter errors. The build will still run.
# To force the step to return zero even with linter errors, add "--exit-zero" after the "check" in the command line

- script: "python3 -m ruff check --format=junit --output-file=$(Build.ArtifactStagingDirectory)/lint-ruff.xml ."
displayName: "Run ruff"
continueOnError: "true"

- task: "PublishTestResults@2"
displayName: "Publish linting results"
Expand Down

0 comments on commit 131afb5

Please sign in to comment.