ci: add workflow to run Ruff on Python code#1095
Merged
RoyalOughtness merged 3 commits intosecureblue:livefrom Jun 3, 2025
Merged
ci: add workflow to run Ruff on Python code#1095RoyalOughtness merged 3 commits intosecureblue:livefrom
RoyalOughtness merged 3 commits intosecureblue:livefrom
Conversation
Collaborator
enforcing style and linting it seems reasonable |
RoyalOughtness
previously approved these changes
Jun 2, 2025
Ruff is a Python linter/formatter: https://docs.astral.sh/ruff/ This workflow runs the Ruff linter on all Python code in the repo. The added `ruff.toml` file configures Ruff's formatting settings; the only change from the default is to set the maximum line length to 100, which was already being used for the audit script. This helps ensure a consistent formatting standard for Python code. Signed-off-by: Daniel Hast <[email protected]>
RoyalOughtness
approved these changes
Jun 3, 2025
EsseLowNitro
approved these changes
Jun 3, 2025
RoyalOughtness
pushed a commit
to RoyalOughtness/secureblue-dev
that referenced
this pull request
Aug 4, 2025
* ci: add workflow to run Ruff on Python code Ruff is a Python linter/formatter: https://docs.astral.sh/ruff/ This workflow runs the Ruff linter on all Python code in the repo. The added `ruff.toml` file configures Ruff's formatting settings; the only change from the default is to set the maximum line length to 100, which was already being used for the audit script. This helps ensure a consistent formatting standard for Python code. Signed-off-by: Daniel Hast <[email protected]> * ci: add format check, use ubuntu-24.04, run only on .py file changes * ci(ruff): only run on pull_request, not push --------- Signed-off-by: Daniel Hast <[email protected]>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This workflow runs Ruff, a very fast Python linter, on all Python code in the repo anytime a pull request modifies Python files. This can catch a wide variety of coding errors; while it'd still be good to add unit tests as discussed in #1093, this makes partial progress on the same issue.
The added
ruff.tomlfile configures Ruff's settings; currently the only change from the default is to set the maximum line length to 100 when formatting, which was already being used for the audit script. This helps ensure a consistent formatting standard for Python code. (The small change made to the audit script is such a formatting change, plus removing an unnecessary.strip()—I did check that the output is the same.)I've also made
ruff format --diffpart of the workflow so it fails if any Python code hasn't been formatted how Ruff would format it.