chore: make python quality expectations explicit#17446
Open
dmcilvaney wants to merge 3 commits into
Open
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
This PR makes Python code quality expectations explicit for the repo by adding Ruff/Pyright configuration and editor defaults, and then reformatting a set of Python files to match the formatter’s output.
Changes:
- Added repository-level Python tooling configs (
ruff.toml,pyrightconfig.json) and a base.editorconfig. - Updated VS Code workspace settings + recommended extensions to standardize formatting/linting behavior.
- Applied automated formatting to multiple Python scripts (repo tooling, image tests, workflow helper scripts).
Reviewed changes
Copilot reviewed 21 out of 21 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| scripts/repo/synthesize-repodata.py | Formatter-only reflow to match the chosen Python formatting rules. |
| scripts/repo/_repo_layout.py | Formatter-only reflow of dataclass fields and constant definitions. |
| ruff.toml | Introduces Ruff lint/format expectations for the repo. |
| pyrightconfig.json | Introduces Pyright type-checking expectations for the repo. |
| base/images/tests/utils/tools.py | Formatter-only reflow for readability/line-length. |
| base/images/tests/utils/pytest_plugin.py | Formatter-only reflow of comprehensions/strings. |
| base/images/tests/utils/extract.py | Formatter-only reflow of command lists and logging calls. |
| base/images/tests/utils/disk.py | Formatter-only reflow of logging call arguments. |
| base/images/tests/conftest.py | Formatter-only reflow of fixture signatures and logging. |
| base/images/tests/cases/vm-base/test_partitions.py | Formatter-only reflow of assertion message formatting. |
| base/images/tests/cases/test_packages.py | Formatter-only reflow of test function signature. |
| .vscode/settings.json | Adds workspace-wide formatting/linting behavior and Python-specific settings. |
| .vscode/mcps/koji-mcp.py | Formatter-only reflow for long lines/prints. |
| .vscode/mcps/fedora-distgit-mcp.py | Formatter-only reflow for long lines and argument lists. |
| .vscode/mcps/_mcp_utils.py | Formatter-only reflow of a multi-line print(...). |
| .vscode/extensions.json | Recommends extensions aligned with the new Python tooling setup. |
| .github/workflows/scripts/spec-review/spec_review_schema.py | Formatter-only reflow for long lines and argument lists. |
| .github/workflows/scripts/spec-review/format_pr_comment.py | Formatter-only reflow for long lines and argument lists. |
| .github/workflows/scripts/spec-review/create_check_annotations.py | Formatter-only reflow for dict literals and CLI arg parsing. |
| .github/workflows/scripts/components/compute_render_set.py | Formatter-only reflow of dict.fromkeys(...) construction. |
| .editorconfig | Adds baseline editor normalization (LF, trim whitespace, final newline). |
01eb727 to
795be6a
Compare
reubeno
reviewed
May 27, 2026
Member
reubeno
left a comment
There was a problem hiding this comment.
Thanks for doing this! Just a couple of quick comments, but I'm very supportive.
Looking at all the Python utility code, I'd also suggest we should look at creating proper Python packages that we maintain in other repos and reference/install in workflows here. We can discuss that offline...
1192b12 to
9bc62fc
Compare
9bc62fc to
e1e6365
Compare
reubeno
approved these changes
May 29, 2026
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.
Note: This does not include actual fixes for the detected issues, it just runs the auto-formatter (i.e. basic fixes like whitespace, no actual code changes).
There are known and expected lint failures across all files. Future developers are expected to validate the auto-fix changes when they save a file and gradually address linter findings.
A summary of current outstanding detections:
Totals
Top ruff rules
assertOptional[X]→X | Nonefrom __future__ import annotationsopenvsPath.openexceptos.path.joinvspathlibLong tail (~80 more rules): missing return annotations, ambiguous names, commented-out code, etc. Full list:
ruff check --statistics.Pyright rules
Top files
(Remaining files have < 5 detections each.)
Reproduce