Skip to content

Rust duplicate improvement#5

Merged
b4prog merged 4 commits into
mainfrom
rust-duplicate-improvement
Jun 26, 2026
Merged

Rust duplicate improvement#5
b4prog merged 4 commits into
mainfrom
rust-duplicate-improvement

Conversation

@b4prog

@b4prog b4prog commented Jun 26, 2026

Copy link
Copy Markdown
Owner

Summary by CodeRabbit

  • New Features
    • Improved language detection with more accurate, per-language handling for several file types (including dedicated patterns for additional formats).
    • Enhanced recognition for Rust, shell, YAML, and Zsh content.
  • Tests
    • Added assertions to ensure language definitions stay properly sorted and avoid overlapping file-extension mappings.
  • Chores
    • Bumped the package version to 0.5.0.

@coderabbitai

coderabbitai Bot commented Jun 26, 2026

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: 7edf043c-b8ca-4c6a-a130-eec3754e5a78

📥 Commits

Reviewing files that changed from the base of the PR and between 15224b1 and af635dd.

📒 Files selected for processing (1)
  • src/language.rs
🚧 Files skipped from review as they are similar to previous changes (1)
  • src/language.rs

📝 Walkthrough

Walkthrough

The PR bumps the crate version to 0.5.0 and reorganizes LANGUAGE_PATTERNS into more granular language entries. It also adds tests for ordering and extension uniqueness.

Changes

Package metadata

Layer / File(s) Summary
Version bump
Cargo.toml
package.version changes from 0.4.0 to 0.5.0.

Language pattern updates

Layer / File(s) Summary
Early pattern split
src/language.rs
The start of LANGUAGE_PATTERNS is rewritten into separate per-language entries, including split JavaScript/TypeScript handling and updated mitigation fields.
Middle pattern additions
src/language.rs
Kotlin, Less, Objective-C, PHP, and PowerShell entries are inserted with their own mitigation patterns, lines, and regexps.
Later pattern reshaping
src/language.rs
Rust mitigation lines are expanded, and later LANGUAGE_PATTERNS entries are reorganized into dedicated Sass/Scala/SCSS/Shell/SQL/Swift/TypeScript/XML patterns with updated extensions and mitigation settings.
Tail patterns and invariant tests
src/language.rs
YAML and Zsh entries are added at the end of LANGUAGE_PATTERNS, and tests assert case-insensitive sorting plus extension uniqueness.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25 minutes

Possibly related PRs

  • b4prog/CodeM8#2: Also updates src/language.rs LANGUAGE_PATTERNS entries and related classification tests.
🚥 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 is relevant to the Rust duplicate-mitigation changes, though it doesn't capture the broader language-pattern updates.
Docstring Coverage ✅ Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%.
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.
✨ 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 rust-duplicate-improvement

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.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@src/language.rs`:
- Around line 53-57: The Fish language entry in language.rs has incorrect
block-terminator keywords in duplicate_mitigation_lines; update the Fish
definition so it uses Fish control-flow terminators instead of POSIX shell ones.
In the Fish entry, keep else and replace do, done, fi, and then with end so the
DuplicateMitigation config matches Fish syntax.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: b31cfb7e-232f-4859-8dbd-5547795d4016

📥 Commits

Reviewing files that changed from the base of the PR and between 72cbef8 and 15224b1.

⛔ Files ignored due to path filters (1)
  • Cargo.lock is excluded by !**/*.lock
📒 Files selected for processing (2)
  • Cargo.toml
  • src/language.rs
📜 Review details
🔇 Additional comments (2)
Cargo.toml (1)

3-3: LGTM!

src/language.rs (1)

493-517: LGTM!

Comment thread src/language.rs
@b4prog

b4prog commented Jun 26, 2026

Copy link
Copy Markdown
Owner Author

@CodeRabbit resume

@coderabbitai

coderabbitai Bot commented Jun 26, 2026

Copy link
Copy Markdown
✅ Action performed

Reviews resumed.

@b4prog b4prog merged commit 7b5cc73 into main Jun 26, 2026
3 checks passed
@b4prog b4prog deleted the rust-duplicate-improvement branch June 26, 2026 08:31
@coderabbitai coderabbitai Bot mentioned this pull request Jun 26, 2026
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