Skip to content

feat: fix the derivable content findings with content:lint --fix - #586

Merged
HugoRCD merged 2 commits into
mainfrom
feat/content-fix
Aug 15, 2026
Merged

feat: fix the derivable content findings with content:lint --fix#586
HugoRCD merged 2 commits into
mainfrom
feat/content-fix

Conversation

@HugoRCD

@HugoRCD HugoRCD commented Aug 14, 2026

Copy link
Copy Markdown
Owner

Stacked on #585.

Some content findings have exactly one correct fix. This applies those, so a reviewer never spends a dispatch on an em dash.

pnpm content:lint <paths…> --fix             # rewrite in place, report every change
pnpm content:lint <paths…> --fix --dry-run   # print what it would do, write nothing

What is derivable, and what is not

A rule reaches lib/fix.mjs only when the corrected text follows from the rule rather than from taste.

Rule Fixed Left to a reader
T-15 evlog/sharedevlog/toolkit, evlog/browserevlog/http a page documenting the deprecation, which is skipped
U-15 sinkdrain, error registryerror catalog child logger, which does not slot into the same sentence
U-16 a link with a redirect behind it a link with no destination
U-14 A — B — CA, B, C the single elaborating dash, which wants a comma here and a colon there

T-13 is absent on purpose: deleting "Here's a breakdown of" leaves "what makes it special:".

On the corpus as it stands that is 51 fixes across 26 files. The two evlog/browser occurrences in the docs are both documenting the deprecation, and both are skipped.

Why it is safe to run unattended

Every file is re-scanned after writing. If the score dropped or a new finding id appeared, the file is reverted and reported as unfixed.

The check is deliberately not "the finding cleared": U-14 and U-15 are reported once per page, so removing one of four dashes leaves the finding standing and still helped. What must hold is that nothing got worse and nothing new appeared. That logic is isSafeFix, tested on its own.

--fix refuses to run without explicit paths. A corpus-wide rewrite is a maintainer's decision.

Checks

20 new tests, 87 total in content:lint:test. No changeset: scripts/ only.

Summary by CodeRabbit

  • New Features

    • Added an optional automatic-fix mode to the content linter.
    • Applies safe corrections for redirects, terminology, punctuation, and retired entry-point references.
    • Supports previewing changes with dry-run mode and reports applied fixes in JSON.
    • Automatically rescans results and reverts changes that reduce content quality.
  • Documentation

    • Added guidance for using automatic fixes, preview mode, supported corrections, and cases requiring manual review.
  • Tests

    • Expanded coverage for correction safety, protected content, redirects, and no-op scenarios.

@vercel

vercel Bot commented Aug 14, 2026

Copy link
Copy Markdown
Contributor

The latest updates on your projects. Learn more about Vercel for GitHub.

5 Skipped Deployments
Project Deployment Actions Updated (UTC)
evi Skipped Skipped Aug 15, 2026 8:39am
evlog-docs Skipped Skipped Aug 15, 2026 8:39am
evlog-render-lab Skipped Skipped Aug 15, 2026 8:39am
evlog-telemetry Skipped Skipped Aug 15, 2026 8:39am
just-use-evlog Skipped Skipped Aug 15, 2026 8:39am

Request Review

@changeset-bot

changeset-bot Bot commented Aug 14, 2026

Copy link
Copy Markdown

⚠️ No Changeset found

Latest commit: 250725b

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@coderabbitai

coderabbitai Bot commented Aug 14, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

Caution

Review failed

The pull request is closed.

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Pro Plus

Run ID: 81f160c9-0d76-4c76-a0a8-86b25ad3ec54

📥 Commits

Reviewing files that changed from the base of the PR and between cb9be7e and 250725b.

📒 Files selected for processing (5)
  • .agents/skills/write-evlog-content/SKILL.md
  • scripts/content-lint/README.md
  • scripts/content-lint/index.mjs
  • scripts/content-lint/lib/fix.mjs
  • scripts/content-lint/lib/fix.test.mjs

📝 Walkthrough

Walkthrough

The content linter adds --fix and --dry-run modes. A Markdown fixer applies deterministic corrections while preserving protected regions. The CLI rescans changes against the full corpus baseline, rejects unsafe fixes, reports results, and documents usage.

Changes

Content lint autofix

Layer / File(s) Summary
Markdown fixer and safety rules
scripts/content-lint/lib/fix.mjs, scripts/content-lint/lib/fix.test.mjs
The fixer applies context-sensitive replacements, follows redirects, preserves protected Markdown regions, records changes, and validates safety.
CLI fix workflow
scripts/content-lint/index.mjs
The CLI supports --fix and --dry-run, validates explicit file targets, compares rescans with the corpus baseline, writes accepted changes, and reports results.
Fix usage guidance
.agents/skills/write-evlog-content/SKILL.md, scripts/content-lint/README.md
The guidance documents eligible fixes, dry runs, rescanning, rollback behavior, and manual-review cases.

Estimated code review effort: 4 (Complex) | ~45 minutes

Sequence Diagram(s)

sequenceDiagram
  participant Contributor
  participant ContentLintCLI
  participant Fixer
  participant ContentScanner
  participant MarkdownFile

  Contributor->>ContentLintCLI: run --fix or --dry-run with paths
  ContentLintCLI->>Fixer: apply deterministic fixes
  Fixer->>MarkdownFile: read and transform content
  ContentLintCLI->>ContentScanner: rescan against corpus baseline
  ContentScanner-->>ContentLintCLI: return findings and score
  ContentLintCLI->>MarkdownFile: write accepted changes
  ContentLintCLI-->>Contributor: report applied, reverted, or dry-run results
Loading

Possibly related PRs

  • HugoRCD/evlog#585: Introduces the content-lint scanner extended by this autofix workflow.

Suggested labels: feature

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feat/content-fix

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@github-actions

Copy link
Copy Markdown
Contributor

Thank you for following the naming conventions! 🙏

@pkg-pr-new

pkg-pr-new Bot commented Aug 14, 2026

Copy link
Copy Markdown
npm i https://pkg.pr.new/@evlog/cli@586
npm i https://pkg.pr.new/evlog@586
npm i https://pkg.pr.new/@evlog/nuxthub@586
npm i https://pkg.pr.new/@evlog/telemetry@586

commit: 250725b

@vercel
vercel Bot temporarily deployed to Preview – evlog-telemetry August 15, 2026 08:39 Inactive
@vercel
vercel Bot temporarily deployed to Preview – evlog-render-lab August 15, 2026 08:39 Inactive
@vercel
vercel Bot temporarily deployed to Preview – evlog-docs August 15, 2026 08:39 Inactive
@vercel
vercel Bot temporarily deployed to Preview – evi August 15, 2026 08:39 Inactive
@vercel
vercel Bot temporarily deployed to Preview – just-use-evlog August 15, 2026 08:39 Inactive
@HugoRCD
HugoRCD merged commit 68849a9 into main Aug 15, 2026
17 of 18 checks passed
@HugoRCD
HugoRCD deleted the feat/content-fix branch August 15, 2026 08:41
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