Conversation
Directory mode resolved one config from the invocation root and applied it to the entire walk, while single-file mode and the language server resolve per file. Any file under a nested odinfmt.json scope was formatted with the wrong style, which the next per-file run then flipped back. Resolve per file (explicit --config still wins for the whole walk).
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.
Directory mode resolved one config from the invocation root and applied it to the entire file walk, while single-file mode and the language server resolve per file.
Any file under a nested odinfmt.json scope was formatted with the wrong style by
odinfmt <dir> -w, which the next per-file/editor run then flipped back - a self-renewing churn loop. It also silently applies ancestor-scope (or default) style to nested scopes on every bulk run.This change resolves the config per walked file, exactly like single-file mode. An explicit --config still wins for the whole walk.
Repro (before): parent scope align_struct_values=false + nested scope true;
odinfmt <parent> -wleft the nested file unaligned while single-file mode aligns it. A 109-char line under a width-120 nested scope inside a width-100 parent was reflowed by dir mode but kept by single-file mode. After: dir mode matches single-file mode on both.Snapshot suite (tools/odinfmt/tests.odin) passes.