82 Commits

Author SHA1 Message Date
Andreas Dangel
d88a3c50fe Fix checkstyle config and checkstyle issues 2024-04-04 10:46:05 +02:00
Andreas Dangel
3a7460de29 [lang-test] Move classes into n.s.p.lang.test 2024-02-23 17:46:23 +01:00
Andreas Dangel
6163f67b06 [core] Rename Tokenizer to CpdLexer
See #4065
2024-01-11 17:04:48 +01:00
Andreas Dangel
55d91791c3 [core] Rename TokenMgrError to LexException
See #4065
2024-01-11 15:56:28 +01:00
Andreas Dangel
32afa53f8e All language modules: getInstance()
Use a consistent implementation of getInstance().
Now all modules resolve against the LanguageRegistry.
2023-08-24 16:01:27 +02:00
Andreas Dangel
681c52836c [core] Create CpdLanguageProperties 2023-08-24 11:14:08 +02:00
Clément Fournier
629e3b415c Consolidate CPD packages 2023-06-10 14:30:07 +02:00
Clément Fournier
c572cb88d7 Rename package cpd.internal to cpd.impl 2023-02-13 15:18:37 +01:00
Clément Fournier
ddbfc90c14 Fix build 2023-02-12 20:06:28 +01:00
Clément Fournier
cf81809990 Change a ton of stuff in CPD 2023-02-10 18:21:23 +01:00
Clément Fournier
d4c05d1fb5 Make pmd language have a hook to launch CPD
This allows removing the CPD language instances,
sharing more logic between CPD and PMD, and using
language properties to configure CPD and PMD uniformly.
2023-02-10 16:45:52 +01:00
Andreas Dangel
7ef6198a3b Merge branch 'pmd/7.0.x' into pmd7-junit5-part2 2022-07-22 21:22:45 +02:00
Clément Fournier
59d931cd91 Merge remote-tracking branch 'upstream/pmd/7.0.x' into text-utils-simple 2022-07-10 13:50:03 +02:00
Andreas Dangel
6086beb4dd [cs] Migrate tests to Junit5 2022-07-07 17:17:36 +02:00
Andreas Dangel
8248f6e4e1 Fix unit tests 2022-05-26 11:49:51 +02:00
Andreas Dangel
82dd4d46ca Merge branch 'master' into pmd/7.0.x 2022-05-26 11:21:38 +02:00
Maikel Steneker
7921e836b1 Add option to ignore C# attributes (annotations) 2022-05-16 16:45:08 +02:00
Clément Fournier
50c00f4f9a Merge branch 'analysis-listener' into text-utils-simple 2021-03-30 02:38:13 +02:00
Andreas Dangel
5dac4a7795 Merge branch 'master' into pmd/7.0.x 2021-01-21 21:00:42 +01:00
Andreas Dangel
f7909ae78a Merge branch 'master' into pr-2963-update 2021-01-21 11:43:01 +01:00
Andreas Dangel
7f1f374dc5 Fixups for #2963
- Add documentation for CPD cli
- Add javadoc for the tokenizer options
- GenericToken::getKind is @Experimental
2021-01-21 11:40:57 +01:00
Clément Fournier
bf60cd1e5b Merge branch 'master' into 7.0.x 2021-01-18 17:08:38 +01:00
Andreas Dangel
e614e256e0 Fix unit tests 2021-01-16 11:49:44 +01:00
Andreas Dangel
f0f2286f98 Merge branch 'master' into pmd/7.0.x 2021-01-16 10:37:27 +01:00
Clément Fournier
aed09d7b9d Merge branch 'master' into pr/2965 2021-01-08 21:42:41 +01:00
Maikel Steneker
77292da7af Add test for empty C# comment.
This was previously incorrectly tokenized, because it was recognized as the start of a documentation comment.
2020-12-23 10:46:34 +01:00
Maikel Steneker
ed8fbccb1c Add tests for additional C# 7 and C# 8 features 2020-12-18 14:47:59 +01:00
Clément Fournier
00bee39767 Merge branch 'analysis-listener' into text-utils-simple 2020-12-13 05:38:09 +01:00
Maikel Steneker
85c807ed1f Add additional test cases for 2D arrays and more 2020-12-10 13:32:49 +01:00
Maikel Steneker
769cf5b316 Update C# grammar for additional C# 7 and C# 8 features 2020-12-10 13:21:48 +01:00
Clément Fournier
fe67ac789a Update C# test references
End column number is exclusive in pmd 7.

Refs #2945
2020-12-01 15:57:46 +01:00
Clément Fournier
1e417186b9 Merge branch 'master' into 7.0.x 2020-12-01 15:44:48 +01:00
Maikel Steneker
aaef0fde4e Add option to ignore sequences of literals
In some cases, code may include sequences of literals that represent lists or tables of constants, such as lookup tables. Large sequences of these (particularly parts with many zeroes) will be identified by CPD as duplicates, but in practice, these are not the types of duplicates that are considered interesting.

This introduces a new option for CPD (--ignore-literal-sequences) that ignores these sequences of literals, in a very similar way to how using directives for C# can already be skipped as well. For now, this functionality is restricted to C#, but it could be added for other languages as well.
2020-11-25 12:35:02 +01:00
Andreas Dangel
346e67b3f0 Merge branch 'master' into pmd/7.0.x 2020-11-23 16:00:01 +01:00
Maikel Steneker
40d4f4a910 [cs] CPD: fix issue where ignoring using directives could not be disabled via the GUI after enabling it 2020-11-20 15:30:23 +01:00
Clément Fournier
efcfb665ad Cleanups for antlr tokenizers 2020-09-17 22:37:10 +02:00
Andreas Dangel
47ab1f34a4 Delete old antlr4 package-infos 2020-09-13 11:41:26 +02:00
Andreas Dangel
4732164a45 Merge branch 'pmd/7.0.x' into pr-2753 2020-09-13 11:40:23 +02:00
Andreas Dangel
3caa6dd0ba Merge branch 'master' into pmd/7.0.x 2020-09-13 11:39:37 +02:00
Andreas Dangel
7a1e3caba0 Add deprecations for antlr lexers that will be moved with PMD 7
Refs pmd/pmd#2753
2020-09-13 11:28:07 +02:00
Clément Fournier
1474ed6e79 Same for C# 2020-08-30 18:54:42 +02:00
Andreas Dangel
2b1d071930 Fix tests due to endColumn changes 2020-08-21 12:38:37 +02:00
Andreas Dangel
ab489832fe Merge branch 'master' into pmd/7.0.x 2020-08-21 11:51:54 +02:00
Maikel Steneker
6fb5ac59b9 Ensure CPD uses tab width of 1 for tabs consistently
The columns that are reported by CPD were inconsistent across languages
before. A language like Java (using a JavaCC-based tokenizer) would use
a width of 8 for tabs, whereas a language like C# (using an Antlr-based
tokenizer) would use 1 instead.

This includes unit tests for most languages to ensure a tab character is
counted as 1. The configuration for JavaCC has been adjusted to respect
this as well.
2020-07-20 10:42:21 +02:00
Andreas Dangel
e4690cb56a Fix compile errors for CPD only languages 2020-07-17 15:04:43 +02:00
Clément Fournier
5b7ed588ea Make CPD end column exclusive
This is to align it with PMD columns,
which in 7.0 are already exclusive.
2020-06-19 02:21:45 +02:00
Clément Fournier
c49d9e315f Merge branch 'master' into 7.0.x 2020-06-19 01:32:32 +02:00
Clément Fournier
fb0819f319 Convert Apex tests 2020-06-14 00:29:58 +02:00
Clément Fournier
4c378b5631 Convert C# module 2020-06-14 00:20:14 +02:00
Andreas Dangel
c3219b91c5 Merge branch 'master' into pmd/7.0.x 2020-06-12 14:21:10 +02:00