Warn about config-local setting overrides - #811
Merged
Merged
Conversation
helly25
force-pushed
the
config/reject-duplicate-settings
branch
from
September 11, 2026 13:53
aea0626 to
93fafb5
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.
Warn when one logical configuration section overrides its own setting, while preserving the existing last-value-wins result. This catches likely copy/paste leftovers without interfering with deliberate command-line overrides, config-tier precedence, expression repetition, or options that accumulate.
AG;DR
--exclude,--summary, and--configstack without a notice;--define=NAME=VALUEand inline--pack-option=NAME=VALUEaccumulate different names but report a repeated name.LookupGlobalArgumentto canonicalize full valued, aliased, sign-suffixed, attached-short, and compatibility spellings to their global registry entry; makeIsKnownGlobaluse that same lookup.--, so expression matchers/actions and their arguments are never mistaken for global settings.XFF.md.hicpp-use-emplacefinding in the keyed-setting test.Validation:
bazel test //... --config=clangbazel test //xff/cli:config_validation_test //xff/cli:globals_test //xff/cli:explain_test //xff/cli:xff_markdown_test --config=xff_docs --config=clangbazel test //xff/cli:config_validation_test --config=clangafter the clang-tidy fixgit diff --check