Skip to content

Add Rust CPD#5414

Merged
adangel merged 12 commits intopmd:mainfrom
juliapaluch:add-rust-cpd
Dec 27, 2024
Merged

Add Rust CPD#5414
adangel merged 12 commits intopmd:mainfrom
juliapaluch:add-rust-cpd

Conversation

@juliapaluch
Copy link
Copy Markdown
Contributor

@juliapaluch juliapaluch commented Dec 20, 2024

Describe the PR

This PR adds CPD support for Rust.

Ready?

  • Added unit tests for fixed bug/feature
  • Passing all unit tests
  • Complete build ./mvnw clean verify passes (checked automatically by github actions)
  • Added (in-code) documentation (if needed)

Comment thread pmd-rust/src/main/java/net/sourceforge/pmd/lang/rust/RustLanguageModule.java Outdated
@adangel adangel added the a:new-language Proposal to add a new PMD or CPD language to the main distribution label Dec 20, 2024
Copy link
Copy Markdown
Member

@adangel adangel left a comment

Choose a reason for hiding this comment

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

Thanks for the PR!

Did you take the grammar from https://github.com/antlr/grammars-v4/tree/master/rust ? That's worth documenting somewhere, as languages evolve and grammars need to be kept up to date... so that we can update downstream/upstream if some parsing problem appears.

@juliapaluch
Copy link
Copy Markdown
Contributor Author

good point! I added a README to the directory where the grammar lives. I also deleted RustParser.g4 because I'm assuming that's unnecessary if we're just tokenizing. Please correct me if I'm wrong and I'll add it back!

@juliapaluch juliapaluch marked this pull request as draft December 20, 2024 19:47
@juliapaluch juliapaluch marked this pull request as ready for review December 20, 2024 23:59
Comment thread pmd-rust/src/main/java/net/sourceforge/pmd/lang/rust/ast/RustLexer.java Outdated
Comment thread pmd-rust/src/main/java/net/sourceforge/pmd/lang/rust/ast/RustLexerBase.java Outdated
@ghost
Copy link
Copy Markdown

ghost commented Dec 21, 2024

1 Message
📖 No regression tested rules have been changed.

Generated by 🚫 Danger

@adangel adangel added this to the 7.9.0 milestone Dec 27, 2024
Copy link
Copy Markdown
Member

@adangel adangel left a comment

Choose a reason for hiding this comment

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

Thanks!

adangel added a commit that referenced this pull request Dec 27, 2024
@adangel adangel merged commit 4b773a0 into pmd:main Dec 27, 2024
adangel added a commit that referenced this pull request Dec 27, 2024
Merge pull request #5414 from juliapaluch:add-rust-cpd
adangel added a commit to pmd/pmd.github.io that referenced this pull request Dec 27, 2024
@juliapaluch juliapaluch deleted the add-rust-cpd branch December 30, 2024 00:47
@adangel adangel added the in:cpd Affects the copy-paste detector label Aug 7, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

a:new-language Proposal to add a new PMD or CPD language to the main distribution in:cpd Affects the copy-paste detector

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants