GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — [cpp] Add option to ignore sequences of literals by maikelsteneker · Pull Request #2963 · pmd/pmd

Conversation

@maikelsteneker

@maikelsteneker maikelsteneker commented Dec 10, 2020

Copy link
Copy Markdown
Contributor

Describe the PR

See PR #2945. This pull request implements the same functionality for C++ (in addition to the previously implemented C#).

When implementing this for C#, I could use the getKind() method on the AntlrToken class. However, JavaCC-based languages like C++ did not have such a method available on the GenericToken interface. Since this functionality is common for all languages that are based on Antlr and JavaCC (so everything except for Scala), I think it makes sense to add this to the interface.

Related issues

  • Similar to [cs] Add option to ignore sequences of literals #2945 (for C++ instead of C#)
  • Includes [cpp] Add support for C++14 binary literals #2962

Ready?

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

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
maikelsteneker added 4 commits December 10, 2020 12:10
@maikelsteneker
Add support for C++14 binary literals
2672834
@maikelsteneker
Add GenericToken.getKind() to interface
af31b3a
@maikelsteneker
C++ can now ignore sequences of literals
3d7fe9f
This enables the --ignore-literal-sequences option for the C++ language. This was previously only implemented for C#.
@maikelsteneker
Filter out 2D arrays as well
55598d8
@ghost

ghost commented Dec 10, 2020 •
edited by ghost
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
1 Message
📖 This changeset changes 0 violations,
introduces 0 new violations, 0 new errors and 0 new configuration errors,
removes 0 violations, 0 errors and 0 configuration errors.
Full report
✅ This changeset changes violations,
introduces new violations, new errors and new configuration errors,
removes violations, errors and configuration errors.
Full report

Generated by 🚫 Danger

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@oowekyala oowekyala added this to the 6.31.0 milestone Dec 11, 2020
@adangel adangel added the an:enhancement An improvement on existing features / rules label Dec 11, 2020
@adangel adangel self-assigned this Jan 19, 2021
@adangel adangel added the in:cpd Affects the copy-paste detector label Jan 21, 2021
adangel
adangel approved these changes Jan 21, 2021
View reviewed changes

@adangel adangel left a comment

Copy link
Copy Markdown
Member

There was a problem hiding this comment.

Choose a reason for hiding this comment

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

Thanks, I'll merge this soon.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
Comment thread pmd-cpp/src/main/java/net/sourceforge/pmd/cpd/CPPTokenizer.java Resolved

Uh oh!

There was an error while loading. Please reload this page.

Comment thread pmd-core/src/main/java/net/sourceforge/pmd/lang/ast/GenericToken.java Resolved

Uh oh!

There was an error while loading. Please reload this page.

@maikelsteneker
Minor changes resulting from review
76566b7
@maikelsteneker

maikelsteneker commented Jan 21, 2021

Copy link
Copy Markdown
Contributor Author

Good suggestions, thank you!

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

adangel added a commit that referenced this pull request Jan 21, 2021
@adangel
Fixups for #2963
7f1f374
- Add documentation for CPD cli
- Add javadoc for the tokenizer options
- GenericToken::getKind is @experimental
adangel added a commit that referenced this pull request Jan 21, 2021
@adangel
[doc] Update release notes, refs #2963
c42f049
adangel added a commit that referenced this pull request Jan 21, 2021
@adangel
Merge pull request #2963 from tiobe:cpp_ignore_literal_lists
a9a9094
[cpp] Add option to ignore sequences of literals #2963#
@adangel
adangel merged commit 76566b7 into pmd:master Jan 21, 2021
@wener-tiobe
wener-tiobe deleted the cpp_ignore_literal_lists branch September 12, 2023 10:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

@adangel adangel adangel approved these changes

Uh oh!

There was an error while loading. Please reload this page.

Assignees

@adangel adangel

Labels

an:enhancement An improvement on existing features / rules in:cpd Affects the copy-paste detector

Projects

None yet

Milestone

6.31.0

Development

Successfully merging this pull request may close these issues.

Uh oh!

There was an error while loading. Please reload this page.

3 participants

@maikelsteneker @adangel @oowekyala
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
You are visitor 01402775 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.