Skip to content

Evaluate includes within exceptions#17

Merged
tuckermcclure merged 5 commits into
mainfrom
tucker/include-within-exceptions
May 12, 2026
Merged

Evaluate includes within exceptions#17
tuckermcclure merged 5 commits into
mainfrom
tucker/include-within-exceptions

Conversation

@tuckermcclure
Copy link
Copy Markdown
Member

@tuckermcclure tuckermcclure commented May 12, 2026

Previously, "exceptions" in the include process were treated as already-complete values. This PR allows them to also include files, which can be a powerful pattern. Consider:

include:
  source: roses.yaml
  except:
    - path: rosaceae.malus # Update this value from literals below.
      value:
        - domestica
        - fusca
    - path: rosaceae.sorbus # Update this value with whatever's in sortbus_list.yaml.
      value:
        include: sorbus_list.yaml

There's no ambiguity in the syntax; it's exactly the same as everywhere else.

I added a test for this behavior. It also pointed out a small bug: the included files were previously assumed to return dictionaries, but they can also return arrays or values. These cases are handled explicitly now and also tested.

I tested this on a downstream project.

@tuckermcclure tuckermcclure merged commit fb78cc4 into main May 12, 2026
6 checks passed
@tuckermcclure tuckermcclure deleted the tucker/include-within-exceptions branch May 12, 2026 17:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant