Repository navigation
feat: add automatic per-extension whitespace comparison - #729
Merged
Merged
Conversation
agavra
approved these changes
Sep 19, 2026
agavra
left a comment
Owner
There was a problem hiding this comment.
Reviewed leniently; no remaining actionable findings. Integrated current main, added the missing pr_comments_visibility field to the test initializer, and moved the detailed whitespace configuration documentation from README.md to docs/CONFIG.md. Validation: cargo fmt, cargo clippy, and cargo test passed (1,785 tests passed, 4 ignored); documentation TOML examples also parse.
|
wow thanks! |
Contributor
Author
|
Thanks for the merge, @agavra. Omitted and false still map to |
1 task
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.
Extend configuration to accept the existing booleans plus the opt-in string
ignore_whitespace = "auto", keeping omitted/false as Normal and true as IgnoreAll, and add anignore_whitespace_overridesTOML table mapping extensions to explicit booleans used only in auto mode. Supply a small documented built-in auto table (json,js,jsx,mjs,cjs,ts,tsx,rsignore whitespace; unknown extensions, extensionless files, Python and YAML compare normally); user entries replace the decision for an extension, never invert their meaning, and describe this as a review heuristic rather than language-semantic equivalence. Issue #700 requests automatic whitespace comparison by file type, retaining whitespace changes for Python/YAML while allowing formatting noise to be ignored for JSON/JavaScript/Rust. Owner agavra explicitly welcomes a default configuration with user overrides; the reporter proposes extension-based configuration and warns that an exception list whose meaning reverses with another boolean would be confusing.Config tests in
src/config/mod.rs: omitted/true/false compatibility, auto defaults, explicit true and false overrides, empty table, inactive-table warning, invalid strings/types, malformed extension keys and normalized collisions. Existing invalid-boolean expectations must be updated deliberately for the expanded accepted syntax; Policy/selection tests in the new production module: uppercase extensions, multi-dot names, extensionless/dotfiles, non-UTF-8 paths where supported, destination-versus-source choice for renames/deletions, and reordered/missing ignored records. Verify original file order and that selected hunk coordinates/content hashes survive unchanged.Fixes #700
AI was used for assistance.