♻️ Make needextend
argument declarative
#1391
Merged
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.
The argument for
needextend
can refer to either a single need ID or filter function.Currently, the format cannot be known until all needs have been processed, and it is resolved during post-processing.
This is problematic for (a) user readability, (b) improving processing performance and issue feedback
This PR slightly modifies the argument processing to allow for two "explicit" formats:
<ID>
, if the argument is enclosed in<>
it is always processed as a single ID"filter string"
, if the argument is enclosed in""
it is always processed as a filter stringIf the string is not enclosed, then the logic is relatively similar to the existing:
ID
, if the argument is a single word (no spaces) then it is processed as a single IDThis change should not break most uses of
needextend
, but there are some corner-cases that would need to be adapted, e.g. a singleis_external
would now be processed as an ID, unless it was enclosed or expanded: