feat(cli): add validate.ignore config for excluding paths from validation#2
Open
pyrex41 wants to merge 1 commit into
Open
feat(cli): add validate.ignore config for excluding paths from validation#2pyrex41 wants to merge 1 commit into
pyrex41 wants to merge 1 commit into
Conversation
…tion The `synapse validate` command discovered files with a hard-coded fast-glob ignore list (node_modules, .git, templates, index.md), giving forks no way to opt a path out of strict body-grammar validation short of renaming a folder to `templates/`. Add an optional `validate.ignore` field to `SynapseConfig`. The new `getValidateIgnore()` helper merges these patterns with the built-in defaults (de-duplicated) and is used at both `glob()` call sites in the validate command. Motivating use case: a downstream fork with a free-form documentation subsection (e.g. `content/210_QA-Memory/`) can now exclude it from validation without folder-renaming hacks. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
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.
Problem
The
synapse validatecommand discovers markdown files withfast-globusing a hard-coded ignore list:This list appears at both
glob()call sites invalidate.ts(the per-directory file set and the full vault cross-reference set). Forks have no way to opt a path out of strict body-grammar validation — the only workaround is renaming a folder totemplates/, which is a misleading hack.Solution
Add an optional
validate.ignorefield toSynapseConfig:getValidateIgnore()helper inlib/config.tsmerges the configured patterns with the built-in defaults (de-duplicated) — it does not replace them, so consumers never need to repeatnode_modules/templates.validatecommand now resolves the ignore list once and passes it to bothglob()call sites.Motivating use case
A downstream fork (FacilityGrid's
fg-synapse) has a free-form documentation subsection —content/210_QA-Memory/— that intentionally does not follow any body grammar. Today that content fails strict validation. Withvalidate.ignorethe fork can exclude it cleanly via config instead of renaming the folder totemplates/.Changes
packages/cli/src/lib/config.ts—SynapseConfig.validate?.ignore, exportedDEFAULT_VALIDATE_IGNORE, andgetValidateIgnore().packages/cli/src/commands/validate.ts— usegetValidateIgnore()at bothglob()call sites.packages/cli/test/lib/config.spec.ts— unit tests forgetValidateIgnore()(defaults, absent/empty config, merge, de-dup).packages/cli/test/commands/validate.spec.ts— end-to-end tests proving an ignored path is skipped while non-ignored paths still validate.README.md— documents the new config field.There is no JSON schema file for
synapse.config.jsonin the repo (the config is typed solely by theSynapseConfigTypeScript interface), so the type update is the schema update.Verification
npm test— 502 passed (24 suites); coverage 88.71% statements / 80.4% branch, above the 80% threshold.config.tsat 97.95% / 100% lines.npm run buildandnpm run check:types— clean.🤖 Generated with Claude Code