Clean up YAML files: lowercase booleans, trailing whitespace, and yamllint integration#3923
Open
igorts-git wants to merge 1 commit into
Open
Clean up YAML files: lowercase booleans, trailing whitespace, and yamllint integration#3923igorts-git wants to merge 1 commit into
igorts-git wants to merge 1 commit into
Conversation
b5632d2 to
6fb3f85
Compare
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
|
🤖 Hi @igorts-git, I've received your request, and I'm working on it now! You can track my progress in the logs for more details. |
There was a problem hiding this comment.
This PR successfully standardizes YAML files across the repository by enforcing YAML 1.2 boolean syntax (lowercase true/false), removing trailing whitespace, and integrating yamllint into the pre-commit pipeline. These changes improve codebase consistency and prevent syntax errors in configuration files.
🔍 General Feedback
- Consistency in Comments: While the PR correctly updates the boolean values in the code, many comments still refer to
TrueorFalse. Consider a follow-up pass to update these comments for full consistency with the new convention. - Permissive Linter Config: The initial
.yamllintconfiguration is quite permissive (disabling rules likeline-lengthandindentation). This is a pragmatic choice for a large-scale initial cleanup, but it might be beneficial to gradually re-enable some of these rules with sensible defaults in the future. - Workflow Formatting: The cleanup of whitespace in GitHub Actions workflows is a good practice that improves maintainability and readability.
| log_config: True # Prints the config (after defaults have been set by pyconfig logic) | ||
| debug_sharding: False # Prints model weights sharding info | ||
| log_config: true # Prints the config (after defaults have been set by pyconfig logic) | ||
| debug_sharding: false # Prints model weights sharding info |
There was a problem hiding this comment.
🟢 For consistency with the new YAML boolean convention, consider updating the comments to use lowercase `true` and `false` as well.
Suggested change
| debug_sharding: false # Prints model weights sharding info | |
| profile_power_events: false # Set to true to enable TPU-specific power/thermal profiling events. Defaults to false to avoid breaking GPU xplane tracing. |
…llint integration
6fb3f85 to
b33ec50
Compare
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.
Description
Overview
This pull request establishes rigorous YAML validation by integrating
yamllintinto pre-commit and standardizing boolean syntax across all configuration files in the MaxText repository.All changes are structural syntax and whitespace adjustments. No configuration parameters, runtime values, or comments were altered.
Key Changes
TrueandFalseboolean values with standard lowercasetrueandfalseacross more than 100 model configurations, inference profiles, and GitHub workflows..ymlfiles (including.github/workflows/).yamllintto.pre-commit-config.yamlalongside a customized.yamllintroot configuration to enforce syntax correctness on future commits.In the
.yamllintfile we explicitly turned off several styling rules to ensure CI tests don't fail over minor formatting preferences:line-length: Allows lines, comments, and URLs to exceed 80 characters.comments: Disables the strict requirement of exactly two spaces before inline comments (key: val # comment).indentation: Permits flexible indentation depth (e.g., 2 vs 4 spaces in multiline dictionaries or lists).commas: Allows compact inline lists without mandatory spaces after commas (e.g.,["silu","linear"]).colons: Allows extra spaces after colons (which is common when aligning dictionary values in columns).empty-lines: Allows multiple consecutive blank lines for visual separation.What Remains active:
syntax: Instantly catches invalid YAML structure, duplicate dictionary keys, and unclosed quotes.truthy: Enforces modern YAML 1.2 booleans (requiring lowercasetrueandfalse, and flagging ambiguous values likeTrue,False,yes,no).trailing-spaces: Flags invisible trailing whitespace at the ends of lines.new-line-at-end-of-file: Ensures files end cleanly with a standard single EOF newline.Tests
CI tests
Checklist
Before submitting this PR, please make sure (put X in square brackets):
gemini-reviewlabel.