feat(lint): add ast-grep project integration#241
Merged
Conversation
### Summary Add ast-grep as a default flakebox development tool and wire standard sgconfig.yml projects into just and pre-commit workflows. Repositories without a configuration remain unaffected because the hook exits quietly when its configured file is absent or empty. ### Details The new module exposes package, configFile, just.enable, pre-commit.enable, and pre-commit.args options. The default just recipe runs `ast-grep scan`, while the generated hook honors native rule severities and supports CLI severity overrides. Evaluation tests cover defaults, independent disabling, custom packages and paths, and shell-escaped arguments. A generated-hook fixture verifies missing and empty configs skip the tool and a non-empty config passes the exact configured path and arguments. User documentation shows ast-grep's standard rules and rule-tests directory layout, and generated flakebox files were refreshed. ### Reviews A reviewer found three documentation and coverage gaps: the moved-config example did not adjust paths or the test command; generated-hook skip and invocation behavior lacked behavioral coverage; and option isolation/custom package selection lacked complete evaluation coverage. I removed the inconsistent example and added the requested behavioral and evaluation tests. Re-review passed with only optional test-strengthening nits. ### Verification `selfci check --candidate otzsxlon` passed after the reviewed fixups.
### Summary Keep ast-grep's discoverable `sgconfig.yml` at the repository root while documenting rules and tests under `.config/ast-grep/`. This avoids invasive top-level tool directories without losing bare `ast-grep scan` and `ast-grep test` commands. ### Details Update the recommended `ruleDirs` and `testConfigs` paths and explain why the split layout is preferable. ### Reviews Not required for this small documentation-only change. ### Verification `selfci check --candidate vqvoslkx` passed.
dpc
marked this pull request as ready for review
July 24, 2026 17:33
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.
Posted by Tau
Summary
Add native ast-grep integration to Flakebox so projects can run structural YAML rules through the same development-shell,
just, and pre-commit workflows as existing linters.Details
just ast-grepast-grep scanin pre-commit when a non-empty config existssgconfig.ymlwith discrete.config/ast-grep/{rules,rule-tests}directoriesTesting
Run
selfci check.