Repository navigation
Closed
Labels
EnhancementNew feature or requestLevel of Effort - LowQuick, well-defined tasks with no unknowns; takes a few hours up to one day to completePriority - LowMinor polish, typo fixes, or technical debt; nice to have; pick up when time permitsScope - BlueprintRelated to solution blueprints in the blueprints directoryScope - FastRelated to Fabric FAST deployment stages in the fast directory
Description
Summary
Format all Python code in the repository according to the Google Python Style Guide, so every file matches Google's corporate coding standards, and replace yapf with ruff as the formatter and linter.
Motivation
Stellar Engine is a Google project, so its code should follow the standards that Google publishes for Python rather than a repository-specific variant.
- The Google Python Style Guide specifies 4-space indentation and 80-character lines.
- The
tools/lint.shscript configuresyapfwithindent_width: 2, which diverges from the published guide. - The
.gemini/styleguide.mdreview guide refers to a.style.yapffile that does not exist in the repository, and it sets a 79-character limit instead of the guide's 80 characters. - New Python projects in the repository, such as the planned
cli/operator tool, need one clear standard to follow from their first commit.
ruff replaces yapf and pyflakes with a single tool.
ruffformats and lints the whole repository in well under a second.ruffhas broad adoption across the Python community, so contributors are likely to know it already.- One
ruff.tomlfile at the repository root holds the formatter settings, the pyflakes-equivalentFrules, and Google-style import sorting. - Self-contained projects such as
cli/can extend the root configuration and enable stricter rule sets, including Google docstring checks.
Proposed change
- Add a root
ruff.tomlfile withindent-width = 4,line-length = 80, and Google-style import sorting. - Switch the
tools/lint.shscript, thetools/requirements.txtfile, and the CIpython-testsjob fromyapfandpyflakestoruff. - Update the Python rules in the
.gemini/styleguide.mdreview guide to match. - Reformat the existing Python files in one mechanical commit, and list that commit in a
.git-blame-ignore-revsfile sogit blameskips it.
Pull request #302 implements this proposal for discussion. Switching back to 2-space indentation later takes a one-line indent-width change and a rerun of ruff format.
Metadata
Metadata
Assignees
Labels
EnhancementNew feature or requestLevel of Effort - LowQuick, well-defined tasks with no unknowns; takes a few hours up to one day to completePriority - LowMinor polish, typo fixes, or technical debt; nice to have; pick up when time permitsScope - BlueprintRelated to solution blueprints in the blueprints directoryScope - FastRelated to Fabric FAST deployment stages in the fast directory
Activity