Skip to content

feat(github-dir): a pack keeps .github to YAML - #85

Merged
mergify[bot] merged 4 commits into
mainfrom
feat/github-dir-pack
Dec 3, 2026
Merged

mergify[bot] merged 4 commits into
mainfrom
feat/github-dir-pack

Conversation

@systemfsoftware-bot

Copy link
Copy Markdown
Contributor

What

Adds a new github-dir pack whose single path rule reports every file under
.github/ that is not a .yml or .yaml file, so CI scripts, templates and
CODEOWNERS live outside the folder GitHub treats as configuration.

Also fixes the fixture harness so a path rule's fixture can judge files in a
hidden directory (see Fixture harness below).

Why

.github/ should hold only the YAML files GitHub reads. A shell or TypeScript
script kept there changes CI without passing the checks that cover the rest of
the tree. A path rule keeps the layout; git cannot say "only YAML here", and a
repository-local rule would serve one repository, while a pack is reusable by
every repository that enables it.

The rule

packs/github-dir/rules/github-dir-yaml-only.md:

scope \.github/.*
allow \.github/.*\.ya?ml

\.github/.*\.ya?ml covers workflows, dependabot.yml, composite action.yml
and issue-form YAML. Scripts, Markdown templates and CODEOWNERS are flagged.
GitHub also reads CODEOWNERS at the repository root or under docs/, so the
rule never strands a GitHub feature; its nextAction names where each file
goes instead.

Fixture harness

select_case_files dropped every case file whose relative path had a
dot-prefixed component, so no fixture could exercise a path rule on files under
a hidden directory such as .github/. A real scan keeps those files and hands
them to no rule's language, so only a path rule judges them (select_files,
is_hidden). The harness now classifies a hidden case file the same way and
skips only .git and node_modules, as walk does. No existing fixture
changed; all stay green.

Verification (head 13cf19e)

Command Exit Result
cargo fmt --all -- --check 0 clean
cargo clippy -p gritlint_core --all-targets -- -D warnings 0 no warnings
cargo test -p gritlint_core 0 136 tests across 11 binaries pass
gritlint test packs 0 414 cases pass (12 github-dir)
gritlint check --format github . 0 no findings on this tree
gritlint schema vs committed 0 only the github-dir block added; gritlint-schema stays green

Red-then-green for the harness: with crates/gritlint_core/src/decode.rs at the
base commit, gritlint test packs exits 2:

ERROR gritlint: the scan root `packs/github-dir/fixtures/github-dir-yaml-only/good/composite-action` selected no files

With this branch it exits 0 with 414 case(s) passed, and every github-dir
case prints ok. The gritlint-packs and gritlint-schema nix checks run the
same commands.

Test and grader changes

  • New pack: packs/github-dir/{pack.json,README.md,rules/github-dir-yaml-only.md,fixtures/github-dir-yaml-only/{bad,good}/**}.
  • crates/gritlint_core/src/decode.rs: select_case_files and skipped.
  • npm/gritlint/configuration_schema.json: regenerated.
  • README.md: pack table row; the Path rules paragraph no longer says hidden files are skipped.
  • .changeset/github-dir-pack.md: minor.

Rollback

Revert the commits. The pack is opt-in per repository via gritlint.json, so a
repository that does not enable it sees no change.

select_case_files dropped every case file whose relative path held a
dot-prefixed component, so no fixture could exercise a path rule on files
under a hidden directory such as .github/. A real scan keeps those files
and hands them to no rule's language, so only a path rule judges them.
Classify a hidden case file the same way, and skip only .git and
node_modules as walk does.
The github-dir pack's path rule reports every file under .github/ that is
not a .yml or .yaml file, so CI scripts and templates live outside the
folder GitHub treats as configuration. Fixtures cover workflows,
dependabot, composite actions and issue forms (allowed), and scripts,
TypeScript, CODEOWNERS and pull-request templates (flagged). The README
lists the pack and no longer claims path rules skip hidden files.
@mergify

mergify Bot commented Dec 3, 2026 •

Copy link
Copy Markdown

Merge Protections

🟢 All 4 merge protections satisfied — ready to merge.

Show 4 satisfied protections

🟢 Merge authority

A PR merges only after the review app approves it (phase 1) or the review bot's review-gate passes (phase 2). A Dependabot patch or minor bump skips the review gate; a major bump still needs it.

  • #changes-requested-reviews-by = 0
  • any of:
    • any of:
      • approved-reviews-by = kiro-systemf[bot]
      • approved-reviews-by = systemfsoftware-bot
    • all of:
      • author = dependabot[bot]
      • any of:
        • dependabot-update-type = version-update:semver-minor
        • dependabot-update-type = version-update:semver-patch
        • title ~= (?i)\bthe [a-z0-9@/._-]*(minor|patch)[a-z0-9@/._-]* group\b
      • dependabot-update-type != version-update:semver-major

🟢 Conventional PR title

The squash commit takes the PR title, so the title must be a conventional commit.

  • title ~= ^(build|chore|ci|docs|feat|fix|perf|refactor|revert|style|test)(\([^)]+\))?!?: \S

🟢 Hold label

The hold label keeps a PR out of the default branch.

  • -label = hold

🟢 🚦 Auto-queue

When all merge protections are satisfied and these conditions match, this pull request will be queued automatically.

  • -draft
  • -label = hold
  • any of:
    • any of:
      • approved-reviews-by = kiro-systemf[bot]
      • approved-reviews-by = systemfsoftware-bot
    • all of:
      • author = dependabot[bot]
      • any of:
        • dependabot-update-type = version-update:semver-minor
        • dependabot-update-type = version-update:semver-patch
        • title ~= (?i)\bthe [a-z0-9@/._-]*(minor|patch)[a-z0-9@/._-]* group\b
      • dependabot-update-type != version-update:semver-major

@systemfsoftware-bot

Copy link
Copy Markdown
Contributor Author

Review note (head 13cf19e): no blocking defects.

  • P0/P1: none. The rule, README, changeset and schema match the scope \.github/.* / allow \.github/.*\.ya?ml behavior, and decode.rs keeps existing fixture behavior while aligning hidden-file handling with the scanner.
  • P2 (accepted, out of scope): the harness fix is proven by the github-dir fixtures (gritlint test packs red at the base commit, green here) rather than also a direct unit test asserting a hidden case file becomes unparsed. A shared classifier between select_case_files and select_files/walk is a possible later cleanup.

No contradictions; no escalation needed.

…TEMPLATE

GitHub reads legacy `.github/ISSUE_TEMPLATE/*.md` issue templates only from
that path, so the rule's "move it out" was unsatisfiable for a valid
configuration. Allow that directory's `.md` files; issue forms are YAML and
already allowed, and `.github/CODEOWNERS` and `.github/pull_request_template.md`
still move to the root or `docs/`. Adds a good fixture for the exempt path.
@mergify mergify Bot added the queued label Dec 3, 2026
@mergify
mergify Bot merged commit b5d361f into main Dec 3, 2026
9 checks passed
@mergify

mergify Bot commented Dec 3, 2026

Copy link
Copy Markdown

✅ Merged into main as b5d361f at 20:10 UTC

8 min in the queue, 7 min of it CI.

So far

  • ✅ Entered the queue Thu 3 Dec, 20:02 · rule default · triggered by merge protections
  • ✅ Passed · draft #86
  • ✅ Merged 20:10 · b5d361f · squash
8 merge conditions met
  • check-success = Nix · aarch64-linux
  • check-success = Nix · x86_64-linux
  • check-success = Tarball and binaries match across systems
  • github-review-approved · required by GitHub repository ruleset rule main
  • title ~= ^(build|chore|ci|docs|feat|fix|perf|refactor|revert|style|test)(\([^)]+\))?!?: \S · required by Merge Protections rule Conventional PR title
  • -label = hold · required by Merge Protections rule Hold label
  • #changes-requested-reviews-by = 0 · required by Merge Protections rule Merge authority
  • any of · required by Merge Protections rule Merge authority:
    • any of:
      • approved-reviews-by = kiro-systemf[bot]
      • approved-reviews-by = systemfsoftware-bot
    • all of:
      • author = dependabot[bot]
      • any of:
        • dependabot-update-type = version-update:semver-minor
        • dependabot-update-type = version-update:semver-patch
        • title ~= (?i)\bthe [a-z0-9@/._-]*(minor|patch)[a-z0-9@/._-]* group\b
      • dependabot-update-type != version-update:semver-major

Times in UTC · dashboard · how the merge queue works

@mergify mergify Bot removed the queued label Dec 3, 2026
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