Add match_none negation to config_setting_group - #634
Open
thii wants to merge 1 commit into
Open
Conversation
config_setting_group can now express negation: settings listed in the
new match_none attribute must not match for the group to match. It can
be combined with match_any or match_all, or used on its own:
selects.config_setting_group(
name = "opt_but_not_stamped",
match_all = [":opt"],
match_none = [":stamped"],
)
Negated settings compile into the existing alias chains: each negated
link resolves to the new //lib:always_false sentinel when its setting
matches and advances otherwise. Since NOT (a OR b) is the same as
(NOT a) AND (NOT b), all combinations reduce to a single AND chain; a
match_any part is compiled into a private "<name>_any" OR group first.
Pure-negation groups end in a dedicated NOT alias.
thii
marked this pull request as ready for review
July 28, 2026 15:40
thii
requested review from
brandjon,
c-mita,
comius,
hvadehra and
tetromino
as code owners
July 28, 2026 15:40
comius
removed their request for review
July 30, 2026 10:44
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.
config_setting_groupcan now express negation: settings listed in thenew
match_noneattribute must not match for the group to match. It canbe combined with
match_anyormatch_all, or used on its own:Negated settings compile into the existing alias chains: each negated
link resolves to the new
//lib:always_falsesentinel when its settingmatches and advances otherwise. Since NOT (a OR b) is the same as
(NOT a) AND (NOT b), all combinations reduce to a single AND chain; a
match_anypart is compiled into a private "_any" OR group first.Pure-negation groups end in a dedicated NOT alias.
Resolves #272