Skip to content

Add support for T-SQL using Antlr4 lexer#4390

Merged
adangel merged 4 commits into
pmd:masterfrom
pguyot:w06/add_support_for_tsql
Feb 16, 2023
Merged

Add support for T-SQL using Antlr4 lexer#4390
adangel merged 4 commits into
pmd:masterfrom
pguyot:w06/add_support_for_tsql

Conversation

@pguyot

@pguyot pguyot commented Feb 10, 2023

Copy link
Copy Markdown
Contributor

Describe the PR

This pull request adds CPD support for T-SQL language using the Antlr4 grammar, following tutorial.

The grammar is taken from https://github.com/antlr/grammars-v4/tree/master/sql/tsql

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)

@pguyot pguyot marked this pull request as draft February 10, 2023 10:21
@pguyot pguyot force-pushed the w06/add_support_for_tsql branch from c5da421 to d20592b Compare February 10, 2023 10:34
@pguyot pguyot marked this pull request as ready for review February 10, 2023 10:34
@ghost

ghost commented Feb 10, 2023

Copy link
Copy Markdown
1 Message
📖 No regression tested rules have been changed.

Generated by 🚫 Danger

@adangel adangel added an:enhancement An improvement on existing features / rules a:new-language Proposal to add a new PMD or CPD language to the main distribution in:grammar About the grammar of a lexer or parser, eg, a parse/lex exception labels Feb 14, 2023

@adangel adangel left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Thanks for the PR! Amazing!

Please have a look at my comments.

Comment thread pmd-tsql/src/main/java/net/sourceforge/pmd/cpd/TSqlLanguage.java Outdated
Comment thread pmd-tsql/src/main/java/net/sourceforge/pmd/cpd/TSqlTokenizer.java Outdated
Comment thread pmd-tsql/src/main/java/net/sourceforge/pmd/lang/tsql/TSqlLanguageModule.java Outdated
Comment thread pmd-tsql/src/main/java/net/sourceforge/pmd/lang/tsql/antlr4/package-info.java Outdated
Comment thread pmd-tsql/src/main/resources/META-INF/services/net.sourceforge.pmd.cpd.Language Outdated
Comment thread pmd-tsql/src/main/resources/META-INF/services/net.sourceforge.pmd.lang.Language Outdated
Comment thread pom.xml Outdated
@adangel adangel added this to the 6.55.0 milestone Feb 14, 2023
@pguyot pguyot force-pushed the w06/add_support_for_tsql branch 5 times, most recently from 945ac4f to e113079 Compare February 15, 2023 13:57
@pguyot

pguyot commented Feb 15, 2023

Copy link
Copy Markdown
Contributor Author

A test no longer passes after these changes, the test that checks the list of available languages in the CLI help.

It works locally with but not on the CI where several classes cannot be instantiated.

https://github.com/pguyot/pmd/actions/runs/4191715718/jobs/7266434608#step:7:8278

@pguyot pguyot force-pushed the w06/add_support_for_tsql branch from e113079 to e9eca6c Compare February 16, 2023 07:00
@pguyot pguyot force-pushed the w06/add_support_for_tsql branch 2 times, most recently from 7e31286 to c9b19b6 Compare February 16, 2023 07:29

@adangel adangel left a comment

Copy link
Copy Markdown
Member

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 Feb 16, 2023
adangel added a commit that referenced this pull request Feb 16, 2023
Add support for T-SQL using Antlr4 lexer #4390
@adangel adangel merged commit f2cae1d into pmd:master Feb 16, 2023
@oowekyala oowekyala mentioned this pull request Feb 16, 2023
5 tasks
@pguyot pguyot deleted the w06/add_support_for_tsql branch February 16, 2023 20:42
@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 an:enhancement An improvement on existing features / rules in:cpd Affects the copy-paste detector in:grammar About the grammar of a lexer or parser, eg, a parse/lex exception

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants