Skip to content

Add possibility to exclude array initializations#6

Merged
brouwers-tiobe merged 8 commits into
tiobe_pmd7from
34422-array-literals
Nov 8, 2024
Merged

Add possibility to exclude array initializations#6
brouwers-tiobe merged 8 commits into
tiobe_pmd7from
34422-array-literals

Conversation

@brouwers-tiobe
Copy link
Copy Markdown

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
@it-tiobe
Copy link
Copy Markdown

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