Skip to content

feat: opt-in engine extension points for non-wiki markdown trees#4

Merged
SunsetDrifter merged 3 commits into
mainfrom
feat/engine-extensions
Jul 6, 2026
Merged

feat: opt-in engine extension points for non-wiki markdown trees#4
SunsetDrifter merged 3 commits into
mainfrom
feat/engine-extensions

Conversation

@SunsetDrifter

Copy link
Copy Markdown
Owner

Summary

Adds nine opt-in config keys to the shared wikilint/ engine so it can lint markdown trees that aren't wikis (a findings folder, a labs journal) without forking. Every knob defaults to the original behavior — the four variants are byte-for-byte unaffected in what they check.

  • markdown_links — relative [text](target) links must resolve on disk (file or directory); inline code spans ignored; resolved page targets count toward inbound links for orphan detection
  • orphans — gate to disable orphan warnings + unlinked-mention hints
  • index_file / index_body_fn — relocate the generated index and/or replace the body generator with a callable; the index is skipped by page discovery when it lives inside a page dir
  • iso_date_fields — which frontmatter fields get ISO-date validation
  • extra_secret_patterns / secret_allow_res — extend the secrets scan; suppress matches on allowlisted lines (template placeholders like ${var}, redaction markers). scan_text_for_secrets exposed for reuse by variant extra_checks
  • log_fileNone disables the log check; same gate added for taxonomy_file and inbox_dir (fixing a latent TypeError when inbox_dir is None)
  • extra_checkscallable(pages, report, root) list appended to every check pass
  • non_page_allowed entries are now fnmatch patterns (exact names still match)

Each variant's lint.py documents the new keys inline; README gains one Design bullet.

Test plan

  • 42/42 tests pass (python3 -m unittest discover -s tests), including the byte-identity and config-key-parity invariants across variants
  • 11 new cases covering each extension point (file-accurate line numbers, discovery skip for a relocated index, allowlist suppression, None-gates, glob layout)
  • CI runs the same suite on this PR

Adds nine config keys, all defaulting to the original behavior so the
four variants are unaffected:

- markdown_links: relative [text](target) links must resolve on disk
  (file or directory); inline code spans are ignored; resolved page
  targets count as inbound links for orphan detection
- orphans: gate to disable orphan warnings and mention hints
- index_file: relocate the generated index (skipped by page discovery
  when it lives inside a page dir)
- index_body_fn: callable(pages) -> str replacing the built-in index
  body generator
- iso_date_fields: which frontmatter fields are validated as ISO dates
- extra_secret_patterns / secret_allow_res: extend the secrets scan and
  suppress matches on allowlisted lines (template placeholders,
  redaction markers); scan_text_for_secrets exposed for reuse
- log_file: None disables the log check (also fixes a latent TypeError
  when inbox_dir is None, plus the same gate for taxonomy_file)
- extra_checks: callables(pages, report, root) appended to check runs

non_page_allowed entries are now fnmatch patterns; exact names still
match as before. Engine stays byte-identical across variants; each
variant's lint.py documents the new keys inline.
11 new cases: markdown-link off-by-default, broken-link with
file-accurate line numbers, resolving file/dir/fragment/external
targets with inbound counting, inline-code immunity, orphan gate,
non_page_allowed globs, relocated + pluggable index (discovery skip,
drift), extra secret patterns with allowlist, configurable ISO-date
fields, None-gates for log/tags/inbox, and extra_checks execution.
Adds use_variant_with() helper for config overrides.
@SunsetDrifter
SunsetDrifter merged commit eb060ba into main Jul 6, 2026
1 check passed
@SunsetDrifter
SunsetDrifter deleted the feat/engine-extensions branch July 6, 2026 14:08
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