Commit Graph

3014 Commits

Author SHA1 Message Date
e1cd3b4c8d Merge branch 'pr-2487'
[all] Cleanup rule test xml #2487
2020-05-22 19:41:01 +02:00
bf16b508f7 Merge branch 'pr-2476'
[java] MethodNamingConventions - Add support for JUnit 5 method naming #2476
2020-05-22 19:30:41 +02:00
aa1722e9e3 [java] Fix TypeHelper if the searched type is not fully qualified 2020-05-22 18:58:59 +02:00
5a6cb7be8b [java] Fix typehelper fallback for simple class name
If there is no auxclasspath, then we still can use imports to
check the full name before we fallback to simple name only.

Also improve RuleTst to actually test without auxclasspath
2020-05-22 17:06:55 +02:00
6049126228 Merge branch 'pr-2465'
[dependencies] Upgrade hamcrest, mockito and JUnit #2465
2020-05-22 11:46:04 +02:00
33bfedc3d9 [java] Enable rule UnnecessaryCast (codestyle)
Added tests, added iterator support
Fixed problem when accessing fields via "this.".
2020-05-22 10:36:24 +02:00
261f2d747a removed unintentional keypress 2020-05-18 16:58:13 -04:00
01c283ce00 Added deprecated tags to code and bestpractices ruleset, updated quickstart ruleset 2020-05-18 16:56:12 -04:00
0cc00277d3 Merge branch 'pr-2474'
[core] Stop JavaCharStream from throwing Error #2474
2020-05-18 20:28:37 +02:00
3449c9a372 Merge branch 'pr-2478'
[java] New rule: LiteralsFirstInComparisons #2478
2020-05-18 20:17:23 +02:00
526526be47 [java] Reformat (whitespaces) LiteralsFirstInComparisons.xml 2020-05-18 20:16:41 +02:00
7138d2e4d4 [doc] Update release notes, refs #2478 2020-05-18 20:11:45 +02:00
0fa0c4a70c [java] add new rule in quickstart.xml 2020-05-18 20:11:04 +02:00
979d81c02e Merge branch 'pr-2481'
[java] Fix JUnitSpellingRule false positive #2481
2020-05-18 19:57:45 +02:00
dfd5e608d6 [java] Remove unnecessary CDATA in JUnitSpelling.xml 2020-05-18 19:55:39 +02:00
ad68cdda24 Fix review remarks 2020-05-16 23:26:24 +03:00
382a1a15f6 Merge branch 'improve-alias-api' 2020-05-16 19:22:10 +02:00
b53edfd350 [java] Cleanup rule test xml files for metrics
Avoid unnecessary CDATA for description
Use 4 space indentation instead of tabs
Remove trailing whitespace
End file with a newline
2020-05-16 18:56:05 +02:00
5ed25a9277 [java] Cleanup rule test xml files (security)
Avoid unnecessary CDATA for description
Use 4 space indentation instead of tabs
Remove trailing whitespace
End file with a newline
2020-05-16 18:56:05 +02:00
3fd74794c8 [java] Cleanup rule test xml files (performance)
Avoid unnecessary CDATA for description
Use 4 space indentation instead of tabs
Remove trailing whitespace
End file with a newline
2020-05-16 18:56:05 +02:00
11d886ec41 [java] Cleanup rule test xml files (multithreading)
Avoid unnecessary CDATA for description
Use 4 space indentation instead of tabs
Remove trailing whitespace
End file with a newline
2020-05-16 18:56:05 +02:00
a80bc88276 [java] Cleanup rule test xml files (errorprone)
Avoid unnecessary CDATA for description
Use 4 space indentation instead of tabs
Remove trailing whitespace
End file with a newline
2020-05-16 18:56:05 +02:00
9ec063b638 [java] Cleanup rule test xml files (documentation)
Avoid unnecessary CDATA for description
Use 4 space indentation instead of tabs
Remove trailing whitespace
End file with a newline
2020-05-16 18:56:05 +02:00
6c914a2a55 [java] Cleanup rule test xml files (design)
Avoid unnecessary CDATA for description
Use 4 space indentation instead of tabs
Remove trailing whitespace
End file with a newline
2020-05-16 18:56:04 +02:00
b19b888a6e [java] Cleanup rule test xml files (codestyle)
Avoid unnecessary CDATA for description
Use 4 space indentation instead of tabs
Remove trailing whitespace
End file with a newline
2020-05-16 18:56:04 +02:00
b9828c2acb [java] Cleanup rule test xml files (bestpractices)
Avoid unnecessary CDATA for description
Use 4 space indentation instead of tabs
Remove trailing whitespace
End file with a newline
2020-05-16 18:56:04 +02:00
72128e1476 fixed the rule version, removed CDATA tags from descriptions 2020-05-15 10:43:51 -04:00
0f552ee620 Further refine the addVersion API 2020-05-15 11:42:28 -03:00
8c7a49eb69 [core] Revamp the language version alias APIs
- The old experimental API allowed calls such as
`addVersions(langHandler, false)` which were not only invalid, but would
throw an `ArrayIndexOutOfBoundsException`, so we split the name
(required) and the aliases (varargs, and therefore optional)
 - In doing so, I was bothered by parameter order. The version name is
the most significant change when setting 2 versions for a language, so I
liked it being first as the old `addVersion` method did, so I moved
that ahead.
 - With that, I now had 2 methods that where equivalent, except one
allowed for varargs and the other didn't… so I merged them. This is not
100% binary compatible, but it is source compatible (that is, unless you
used reflection, all valid calls to the old non-experimental method
still work).
2020-05-14 16:03:45 -03:00
8fce3a300f [java] Small refactoring for JUnitTestsShouldIncludeAssertRule 2020-05-14 20:30:24 +02:00
8b5be784fd fix pmd violation 2020-05-13 02:05:27 +03:00
d349d66696 fix JUnitSpellingRule false positive, closes #2477. Also add two more tests 2020-05-13 01:46:36 +03:00
1f0d7ae620 [java] False positive with Hamcrest's assertThat
Fixes #2288
2020-05-12 17:51:54 -04:00
99db8b4373 Added new rule to bestpractices category, added unit tests for all comparison cases 2020-05-12 17:07:21 -04:00
8ff452080b Added new rule corresponding to all string literal comparisons 2020-05-12 17:06:08 -04:00
5053b7beb4 review fixes: exclude hamcrest-library, hamcrest-core from junit, rm assertj-core from root pom, move mockito, wiremock and system-rules to test scope 2020-05-11 15:25:07 +03:00
a0e2558ca2 Add a test case for the JUnit 5 naming rules 2020-05-11 11:53:53 +02:00
db590fdefd Add support for JUnit 5 method naming
Tests that are annotated with org.junit.jupiter.api.Test were not
recognized as unit tests.

Provide detection for JUnit 5 style tests and also provide the possibility
to customize the method naming regex similar to the existing ones.
2020-05-11 11:43:53 +02:00
bf027382f5 Test 2020-05-07 18:14:42 +02:00
3fba3f6217 Update hamcrest to 2.2, Junit to 4.13, mockito to 2.28.2 2020-05-04 23:00:28 +03:00
0adb7c8635 Add some DeprecatedAttribute annotations
This improves warnings for XPath rules
2020-04-28 08:23:27 +02:00
b2dc358aba Operator Wrap check 2020-04-27 09:09:07 +05:30
a88440bea9 Fix #2437 2020-04-24 16:44:52 +02:00
4308c545e5 [maven-release-plugin] prepare for next development iteration 2020-04-24 10:53:12 +02:00
921c65f5ab [maven-release-plugin] prepare release pmd_releases/6.23.0 2020-04-24 10:53:00 +02:00
aee04b4c68 [java] Fix more deprecated attribute usages 2020-04-18 19:06:29 +02:00
bcae7e5243 Small corrections 2020-04-18 18:20:27 +02:00
e2ec5450ff Update rules
WARNING: Use of deprecated attribute 'VariableDeclaratorId/@Image' by rule Error Prone/AvoidEnumAsIdentifier, please use @Name instead
WARNING: Use of deprecated attribute 'VariableDeclaratorId/@Image' by rule Error Prone/AvoidAssertAsIdentifier, please use @Name instead
WARNING: Use of deprecated attribute 'VariableDeclaratorId/@Image' by rule Error Prone/ProperLogger, please use @Name instead
WARNING: Use of deprecated attribute 'VariableDeclaratorId/@Image' by rule Error Prone/JumbledIncrementer, please use @Name instead
WARNING: Use of deprecated attribute 'VariableDeclaratorId/@Image' by rule Error Prone/AvoidLosingExceptionInformation, please use @Name instead
WARNING: Use of deprecated attribute 'VariableDeclaratorId/@Image' by rule Error Prone/EmptyCatchBlock, please use @Name instead
2020-04-17 20:34:42 +02:00
f3db39641a Test with ASTVariableDeclaratorId#getName 2020-04-17 20:28:00 +02:00
be152e92a8 Output replacement as well 2020-04-17 20:18:32 +02:00