Skip to content

[codex] Add legacy OS name lint rule#341

Merged
youyongsong merged 2 commits into
mainfrom
codex/add-legacy-os-name-lint
Jun 22, 2026
Merged

[codex] Add legacy OS name lint rule#341
youyongsong merged 2 commits into
mainfrom
codex/add-legacy-os-name-lint

Conversation

@youyongsong

@youyongsong youyongsong commented Jun 22, 2026

Copy link
Copy Markdown
Collaborator

Summary by CodeRabbit

  • New Features

    • Added a new documentation lint rule that flags legacy OS name mentions (e.g., MicroOS and KubeOS) across markdown content, frontmatter, and MDX attributes.
  • Tests

    • Added a dedicated test suite covering text, code blocks, frontmatter, and MDX attribute scenarios to verify expected lint findings.
  • Chores

    • Updated Prettier, ESLint, and TypeScript configuration to ignore the vendor directory.
  • Release

    • Included a patch release note for the new lint enforcement.

@changeset-bot

changeset-bot Bot commented Jun 22, 2026

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: a4a15ef

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
@alauda/doom Patch

Not sure what this means? Click here to learn what changesets are.

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

@coderabbitai

coderabbitai Bot commented Jun 22, 2026

Copy link
Copy Markdown

Review Change Stack

Warning

Review limit reached

@youyongsong, we couldn't start this review because you've reached your PR review rate limit.

More reviews will be available in 41 minutes and 26 seconds. Learn how PR review limits work.

Your organization has used up its prepaid credits, and credit purchases are no longer available. Enable the review add-on in the billing tab to keep reviews running — you're only billed for reviews past your plan's rate limits ($0.25/file).

⌛ How to resolve this issue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based credits.

🚦 How do rate limits work?

CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan refill rate.

For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, the refill rate gradually slows as usage increases. The highest same-day bursts are limited more strictly.

Please see our Fair Usage Limits Policy for further information.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 019ac025-358a-40c2-a4de-996581ed2e42

📥 Commits

Reviewing files that changed from the base of the PR and between 648843e and a4a15ef.

📒 Files selected for processing (1)
  • packages/doom/src/cli/index.ts

Walkthrough

Adds a new doom-lint:no-legacy-os-names remark-lint rule to @alauda/doom that detects legacy OS name variants (MicroOS, KubeOS, micros, etc.) in Markdown nodes and MDX JSX attributes. The rule is re-exported from the lint index and registered in remarkrc.ts. A test suite and a patch changeset entry are included. The vendor directory is excluded from Prettier, ESLint, and TypeScript.

Changes

no-legacy-os-names lint rule

Layer / File(s) Summary
Core lint rule: regex, helpers, and AST traversals
packages/doom/src/remark-lint/no-legacy-os-names.ts
Defines LEGACY_OS_NAME_REGEX (Unicode-aware, matching micro os/micros/kube os variants) and AST helper types (StringValueNode, isStringValueNode). Implements two visitParents traversals: one scans string-valued nodes, another scans MDX JSX element attributes. Both extract and report legacy OS name matches via vfile.message with position and ancestors.
Rule export and remarkrc registration
packages/doom/src/remark-lint/index.ts, packages/doom/src/remarkrc.ts
Re-exports noLegacyOSNames from the remark-lint index and adds it to the plugins array in the remark configuration (after noDeepList).
Tests, changeset, and vendor tooling config
packages/doom/test/remark-lint/no-legacy-os-names.spec.ts, .changeset/add-legacy-os-name-lint.md, .prettierignore, eslint.config.js, tsconfig.json
Adds a test suite with four async test cases covering allowed names, legacy variants in markdown, detection in frontmatter/code blocks, and MDX JSX string attributes. Adds a patch changeset entry. Excludes vendor directory from Prettier, ESLint top-level ignores, and TypeScript exclude.

Sequence Diagram

sequenceDiagram
  participant RemarkProcessor
  participant noLegacyOSNames
  participant StringTraversal as visitParents<br/>(string nodes)
  participant JSXTraversal as visitParents<br/>(mdxJsx elements)
  participant VFile

  RemarkProcessor->>noLegacyOSNames: invoke rule on AST root
  noLegacyOSNames->>StringTraversal: walk root for string-valued nodes
  StringTraversal->>StringTraversal: test node.value against LEGACY_OS_NAME_REGEX
  StringTraversal->>VFile: message(match) with node.position
  noLegacyOSNames->>JSXTraversal: walk root for mdxJsxFlowElement/TextElement
  JSXTraversal->>JSXTraversal: iterate attributes, extract string values
  JSXTraversal->>JSXTraversal: test attribute value against LEGACY_OS_NAME_REGEX
  JSXTraversal->>VFile: message(match) with attribute.position
  noLegacyOSNames->>RemarkProcessor: return rule result
Loading

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Poem

🐇 Hop hop, no more old OS names in sight,
A regex patrol checks each node just right.
MicroOS, KubeOS — banished with care,
The AST walks find them everywhere.
✨ Clean docs ahead, the warren agrees!

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately describes the main objective of the pull request: adding a new remark lint rule that detects legacy OS names (MicroOS, KubeOS). It is concise, specific, and clearly summarizes the primary change across all modified files.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch codex/add-legacy-os-name-lint

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 and usage tips.

@pkg-pr-new

pkg-pr-new Bot commented Jun 22, 2026

Copy link
Copy Markdown

Open in StackBlitz

yarn add https://pkg.pr.new/@alauda/doom@341.tgz
yarn add https://pkg.pr.new/@alauda/doom-export@341.tgz

commit: a4a15ef

@youyongsong youyongsong marked this pull request as ready for review June 22, 2026 08:44
@youyongsong youyongsong force-pushed the codex/add-legacy-os-name-lint branch from c75c6d6 to 648843e Compare June 22, 2026 09:53
@codecov

codecov Bot commented Jun 22, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 91.89189% with 3 lines in your changes missing coverage. Please review.
✅ Project coverage is 53.88%. Comparing base (ad8af04) to head (a4a15ef).

Files with missing lines Patch % Lines
...ackages/doom/src/remark-lint/no-legacy-os-names.ts 91.89% 3 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #341      +/-   ##
==========================================
+ Coverage   52.93%   53.88%   +0.94%     
==========================================
  Files          60       61       +1     
  Lines        1483     1520      +37     
  Branches      460      471      +11     
==========================================
+ Hits          785      819      +34     
- Misses        539      542       +3     
  Partials      159      159              

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@youyongsong youyongsong merged commit ab3e740 into main Jun 22, 2026
17 checks passed
@youyongsong youyongsong deleted the codex/add-legacy-os-name-lint branch June 22, 2026 10:28
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