Skip to content

feat: add ci-lint-enforcement rule (#49)#58

Open
olavostauros wants to merge 2 commits into
KnickKnackLabs:mainfrom
olavostauros:feat/ci-lint-enforcement
Open

feat: add ci-lint-enforcement rule (#49)#58
olavostauros wants to merge 2 commits into
KnickKnackLabs:mainfrom
olavostauros:feat/ci-lint-enforcement

Conversation

@olavostauros

Copy link
Copy Markdown

Summary

Implements a new lint rule ci-lint-enforcement that checks repos with [_.codebase].lint configured have aggregate codebase lint enforcement in CI.

Fixes #49.

Rule behavior

Scenario Exit Output
Aggregate lint in CI workflow 0 OK <repo> (N rule(s) enforced in M workflow(s))
Indirect via local task delegation 0 OK <repo> ...
Aggregate + per-rule loops 0 WARN <repo> ... (drift-prone)
Lint configured, no enforcement 1 FAIL <repo>: lint configured but no aggregate enforcement in CI
No [_.codebase].lint 0 SKIP <repo>
--fix mode 0 Adds enforcement step + provisions shiv:codebase

Detection patterns

  • Direct: codebase lint "$PWD", codebase lint ., codebase lint $PWD
  • Mise exec: mise exec -- codebase lint ...
  • Indirect: traces mise run test → checks .mise/tasks/test for codebase lint / $CODEBASE_BIN lint
  • Per-rule loops: codebase lint:<rule-name> → WARN (drift-prone, not FAIL)

Files changed

File Change
.mise/tasks/lint/ci-lint-enforcement New lint rule (~370 lines)
test/lint/ci-lint-enforcement/ci-lint-enforcement.bats 13 BATS tests
test/lint/ci-lint-enforcement/fixtures/ 7 fixture scenarios

Validation

  • mise run test — all 232 tests pass (13 new ci-lint-enforcement tests at indices 45–57)
  • codebase lint:ci-lint-enforcement . — SKIP (codebase repo has no [_.codebase].lint)
  • ShellCheck-clean (SC1091, SC2034, SC2154 excluded per convention)
  • Follows existing patterns: codebase-config.sh helpers, resolve_target(), collect_workflows(), codebase:ignore mechanism

…ts in CI

Implements KnickKnackLabs#49 — a new lint rule that detects repos with [_.codebase].lint configured but no aggregate codebase lint enforcement in CI workflows.

Key features:
- Scans workflow YAMLs for direct patterns (codebase lint "$PWD"),
  mise exec indirection, and indirect delegation via local tasks
- Warns on drift-prone hard-coded per-rule loops
- --fix mode adds aggregate enforcement step and provisions codebase CLI tooling
- Respects codebase:ignore mechanism
- 13 BATS tests across 7 fixture scenarios (direct, indirect, missing,
  hardcoded-loop, loop-only, no-config, ignored, no-workflows)

All 232 tests pass (13 ci-lint-enforcement tests at indices 45-57).
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.

lint: require configured codebase lints to run in CI

1 participant