Files
Jamie Tanna 2a300e8d08 refactor(config): specify scopes for enabled and managerFilePatterns (#46683)
* refactor(config): specify scopes for `enabled` and `managerFilePatterns`

As part of #43020, the two options which name every manager - and in
`enabled`'s case, every update type - can describe where they're valid
through `scopes` instead, so they no longer need updating when a
manager is added.

This allows us to simplify the way that the parents are defined, and
will now result in an improved error message i.e.

```
"managerFilePatterns" can't be used at the top level of a config, as it
can only be used in a manager's config or in `customManagers`.
```

Co-authored-by: Claude Opus 5 <jamie.tanna+claude-code@mend.io>

* fixup! refactor(config): specify scopes for `enabled` and `managerFilePatterns`

getConfig() decides whether an option gets a top-level default by
checking the raw option.parents for '.', which doesn't know about
scopes. Giving `enabled` its top-level eligibility through `scopes`
instead of a literal `parents: ['.']` entry meant getConfig() stopped
giving it a default value at all, so `config.enabled` became undefined
at the top level - breaking anything that reads it before a manager's
own config is merged in, such as extract-fingerprint-config.ts.

We can use getAllowedParents(), which already knows how to combine
scopes and parents, instead of reading option.parents directly.

Co-Authored-By: Claude Sonnet 5 <jamie.tanna+claude-code@mend.io>

---------

Co-authored-by: Claude Opus 5 <jamie.tanna+claude-code@mend.io>
2026-10-12 12:09:14 +00:00
..