Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add possibility to exclude array initializations #6

Merged
merged 8 commits into from
Nov 8, 2024

Conversation

brouwers-tiobe
Copy link

See PR34422.

This adds the ability to exclude array initializations in C/C++ from duplication. Specifically, {} -delimited comma-separated lists that directly follow an assignment (=) are skipped.

Rather than adding yet another variant of the --ignore-sequences/--ignore-literal-sequences flag, the --ignore-sequences option now optionally takes a parameter (one of 'literals', 'literals-identifiers', 'initializations'). If no parameter is provided, it behaves the same as the original --ignore-sequences flag, ignoring sequences of literals and identifiers.

The --ignore-sequences option now optionally takes an argument specifying which 'ignore sequence' strategies should be applied. Multiple strategies can be enabled by providing the option multiple times.

The existing behavior of --ignore-sequences without a parameter (defaulting to 'ignore literal and identifier sequences') and --ignore-literal-sequences is preserved.
@brouwers-tiobe brouwers-tiobe marked this pull request as ready for review November 4, 2024 15:13
@brouwers-tiobe brouwers-tiobe merged commit 0b1d2e2 into tiobe_pmd7 Nov 8, 2024
3 checks passed
@it-tiobe
Copy link

it-tiobe commented Nov 8, 2024

Build artifact: CPD

Tool Download
CPD CPD-0.1.0+273.zip

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.

3 participants