Skip to content

fix(config): accumulate plugins.tags across imports - #224

Merged
santosr2 merged 1 commit into
mainfrom
fix/config-merge-plugin-tags
Jul 9, 2026
Merged

fix(config): accumulate plugins.tags across imports#224
santosr2 merged 1 commit into
mainfrom
fix/config-merge-plugin-tags

Conversation

@santosr2

@santosr2 santosr2 commented Jul 9, 2026

Copy link
Copy Markdown
Owner

What and why

When a config imports another file, merge() combined most fields but silently dropped plugins.tags. A tag filter defined in an imported config therefore had no effect: rules were loaded as if no filter existed. This unions the imported tags into the base, mirroring how plugins.directories already accumulates.

Why: plugins.tags is an any-match filter applied at plugin load time, so accumulation only ever widens it (an import can loosen the filter, never narrow it). Previously the field was write-only from an import's perspective, making modular tag configuration impossible.

How to test

mise run test -- -run TestConfig_merge_PluginTagsAppended ./internal/config/

Covers two cases: base and import tags combining into a union, and import tags flowing into an empty base.

Notes for reviewers

  • Behavior change users can observe: tag filters set in imported configs now take effect. It fixes previously-broken behavior rather than changing a documented contract, so it is not a breaking change.
  • Docs updated in configuration.md: documents tag accumulation and the broader list-vs-scalar merge split (exclude, plugins.directories, plugins.tags accumulate; scalars and maps override).

Checklist

  • I have read the CONTRIBUTING guidelines
  • My code follows the project's code style
  • I have added tests that prove my fix/feature works
  • All checks pass (mise run check runs fmt, vet, lint, and test)
  • I have updated documentation as needed
  • My commits follow Conventional Commits

🤖 Generated with Claude Code

Imported configs set plugins.tags but merge() dropped them, so a tag
filter defined in an imported file had no effect. Union the tags like
plugins.directories so an import only ever widens the filter (tags are
any-match at load time). Documents the accumulate-vs-override split for
list keys.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@codecov

codecov Bot commented Jul 9, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

@santosr2
santosr2 merged commit c77e825 into main Jul 9, 2026
54 checks passed
@santosr2
santosr2 deleted the fix/config-merge-plugin-tags branch July 9, 2026 22:41
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