Skip to content

fix: clear hand-written validate --all violations, correct the mo:base check - #357

Open
marc0olo wants to merge 1 commit into
mainfrom
infra/validate-clean
Open

fix: clear hand-written validate --all violations, correct the mo:base check#357
marc0olo wants to merge 1 commit into
mainfrom
infra/validate-clean

Conversation

@marc0olo

Copy link
Copy Markdown
Member

Summary

npm run validate (--all) reported 11 errors on main. This clears the 4 that are in hand-written pages. The remaining 7 are in a synced file and are tracked in #356.

  • 2 em-dashes replaced in prose (data-persistence.mdx, chain-key-tokens.mdx)
  • mo:base check corrected in scripts/validate.js

Why the mo:base check changed

checkForbiddenPatterns skips fenced code, so the old /mo:base/ pattern could only ever match prose. That is backwards for this rule:

  • an actual import Buffer "mo:base/Buffer"; lives inside a fence and was never flagged;
  • naming the legacy library in prose is legitimate and was flagged. Both hits on main were the base-to-core migration table in data-persistence.mdx ("Use these in preference to the legacy mo:base equivalents", and the Replaces (mo:base) column header), which is the same mapping AGENTS.md itself spells out.

The rule now matches the import path mo:base/ and opts into fence checking via a per-rule includeFences flag, so the other two patterns keep their prose-only behaviour.

Verified both directions:

$ node scripts/validate.js docs/__tmp-check.md
docs/__tmp-check.md: line 9: "mo:base/" import is banned — use "mo:core" instead

with the fixture containing an import inside a fence plus a prose mention; only the import is reported. A scan of docs/ confirms there are no mo:base/ imports being missed today.

Verification

npm run validate goes from 11 errors to 7 (all 7 in docs/references/internet-identity-spec.md, synced from dfinity/internet-identity, see #356). npm run build passes.

…e check

Replaces two em-dashes in prose, and fixes the mo:base rule so it matches
imports (mo:base/) inside code fences instead of legitimate prose mentions
of the legacy library in base-to-core migration tables.
@marc0olo
marc0olo requested a review from a team as a code owner August 26, 2026 11:22
@github-actions

github-actions Bot commented Aug 26, 2026

Copy link
Copy Markdown

🤖 Here's your preview: https://mmsik-fiaaa-aaaam-ahq7a-cai.icp0.io

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