feat: opt-in engine extension points for non-wiki markdown trees#4
Merged
Conversation
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.
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.
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 detectionorphans— gate to disable orphan warnings + unlinked-mention hintsindex_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 diriso_date_fields— which frontmatter fields get ISO-date validationextra_secret_patterns/secret_allow_res— extend the secrets scan; suppress matches on allowlisted lines (template placeholders like${var}, redaction markers).scan_text_for_secretsexposed for reuse by variantextra_checkslog_file—Nonedisables the log check; same gate added fortaxonomy_fileandinbox_dir(fixing a latentTypeErrorwheninbox_dirisNone)extra_checks—callable(pages, report, root)list appended to every check passnon_page_allowedentries are now fnmatch patterns (exact names still match)Each variant's
lint.pydocuments the new keys inline; README gains one Design bullet.Test plan
python3 -m unittest discover -s tests), including the byte-identity and config-key-parity invariants across variants