Skip to content

refactor: batch infrastructure — lint groups + multi-path scope (#69, #56)#72

Closed
olavostauros wants to merge 2 commits into
KnickKnackLabs:mainfrom
olavostauros:batch/infrastructure
Closed

refactor: batch infrastructure — lint groups + multi-path scope (#69, #56)#72
olavostauros wants to merge 2 commits into
KnickKnackLabs:mainfrom
olavostauros:batch/infrastructure

Conversation

@olavostauros

@olavostauros olavostauros commented Jun 26, 2026

Copy link
Copy Markdown

Summary

Stacked batch 1/4. See ricon-family/olavo#9.

Consolidates two infrastructure PRs that unblock all downstream lint rules:

Rules included

Rule Issue Description
lint groups #69 Standard convention bundles for common lint rule combinations
multi-path scope #56 Support multiple scope values in [_.codebase.scope]

Commits

Commit Description
8525603 fix: support multi-path scope values in [_.codebase.scope]
d98a783 feat(lint): add lint groups for standard convention bundles

Validation

  • mise run test — 236 tests passing
  • git diff --check — clean

The codebase_target_for_rule() function treated the entire scope value as
a single path, so a TOML string like or-true = ".mise/tasks lib" would
produce a single target /repo/.mise/tasks lib (with space) instead of
two separate targets /repo/.mise/tasks and /repo/lib.

This meant multi-path scope overrides either errored (path doesn't exist)
or silently scanned nothing — users thought they had multi-path coverage
but got false passes.

Changes:
- lib/codebase-config.sh: Replace codebase_target_for_rule() with
  codebase_targets_for_rule() that splits the scope value on whitespace
  and emits one target line per token.
- .mise/tasks/lint/_default: Iterate over the multi-line output so each
  target is linted independently.
- test/lint/default.bats: Add test covering multi-path scope with
  space-separated path list.

The fix uses shell word-splitting on the scope string (unquoted  in
a for loop), which naturally handles TOML string values with internal spaces.
Each token is resolved as a relative path against the repo root, or passed
through unchanged if absolute.

Fixes KnickKnackLabs#22
Adds first-class lint groups/presets so repos can opt into convention
bundles with a single @maintained-tool reference instead of enumerating
every lint rule individually.

Includes:
- lib/lint-groups.sh — built-in group registry, expansion, and
  discoverability functions
- lib/codebase-config.sh — source lint-groups.sh, expand @group
  references in codebase_configured_lint_rules(), support lint_exclude
- .mise/tasks/lint/_default — show expanded group count in preamble;
  updated error hint to mention groups
- .mise/tasks/lint/groups — new lint:groups discoverability task
- test/lint/lint-groups/ — 17 BATS tests

Closes KnickKnackLabs#69
@olavostauros

Copy link
Copy Markdown
Author

Closing this stacked batch in favor of individual re-evaluation. See ricon-family/olavo#9 for context.

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