Repository navigation
feat(github-dir): a pack keeps .github to YAML - #85
Merged
Merged
Conversation
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.
Merge Protections🟢 All 4 merge protections satisfied — ready to merge. Show 4 satisfied protections🟢 Merge authorityA 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.
🟢 Conventional PR titleThe squash commit takes the PR title, so the title must be a conventional commit.
🟢 Hold labelThe hold label keeps a PR out of the default branch.
🟢 🚦 Auto-queueWhen all merge protections are satisfied and these conditions match, this pull request will be queued automatically.
|
Contributor
Author
|
Review note (head 13cf19e): no blocking defects.
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.
33 of 52 tasks
✅ Merged into
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Adds a new
github-dirpack whose single path rule reports every file under.github/that is not a.ymlor.yamlfile, so CI scripts, templates andCODEOWNERSlive 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 TypeScriptscript 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:\.github/.*\.ya?mlcovers workflows,dependabot.yml, compositeaction.ymland issue-form YAML. Scripts, Markdown templates and
CODEOWNERSare flagged.GitHub also reads
CODEOWNERSat the repository root or underdocs/, so therule never strands a GitHub feature; its
nextActionnames where each filegoes instead.
Fixture harness
select_case_filesdropped every case file whose relative path had adot-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 handsthem 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 andskips only
.gitandnode_modules, aswalkdoes. No existing fixturechanged; all stay green.
Verification (head 13cf19e)
cargo fmt --all -- --checkcargo clippy -p gritlint_core --all-targets -- -D warningscargo test -p gritlint_coregritlint test packsgithub-dir)gritlint check --format github .gritlint schemavs committedgithub-dirblock added;gritlint-schemastays greenRed-then-green for the harness: with
crates/gritlint_core/src/decode.rsat thebase commit,
gritlint test packsexits 2:With this branch it exits 0 with
414 case(s) passed, and everygithub-dircase prints
ok. Thegritlint-packsandgritlint-schemanix checks run thesame commands.
Test and grader changes
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_filesandskipped.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 arepository that does not enable it sees no change.