Compare commits

...
Author SHA1 Message Date
Andreas Dangel b49fb2014d [maven-release-plugin] prepare release pmd_releases/6.35.0 2021-05-29 07:24:39 +02:00
Andreas Dangel 22004e1eba Prepare pmd release 6.35.0 2021-05-29 07:13:48 +02:00
Andreas Dangel 6d321b89e4 [ci] Use new build-tools 13
Should fix build problems under windows
2021-05-28 17:45:00 +02:00
Andreas Dangel 1fce60faf0 [ci] Use ruby/setup-ruby@v1 instead of deprecated setup-ruby action 2021-05-28 16:59:31 +02:00
Andreas Dangel 50080c496d [ci] Use ruby/setup-ruby@v1 instead of deprecated setup-ruby action 2021-05-28 16:57:32 +02:00
Andreas Dangel 2b126e3236 Reference new rule CognitiveComplexity 2021-05-28 16:56:13 +02:00
Clément Fournier b520361d71 Merge branch 'pr/3277'
refs #3277
2021-05-28 13:01:02 +02:00
Clément Fournier 836f77e950 Merge branch 'master' into pr/3277 2021-05-28 13:00:52 +02:00
Clément Fournier 2298f302b4 Release notes, close #2329 2021-05-28 12:50:31 +02:00
Clément Fournier 62c70ae813 Update contribution list #3293 2021-05-28 12:48:40 +02:00
Clément Fournier 6e4a0ef7b0 Fix cdata in rule description
refs #3293
2021-05-28 12:43:15 +02:00
Clément Fournier b1a22357b9 Merge branch 'pr/3293' 2021-05-28 12:40:30 +02:00
Clément Fournier 3b81ff581f Update release notes, refs #3293 2021-05-28 12:34:32 +02:00
Clément Fournier eb8e7c2756 Add a bit of doc 2021-05-28 12:23:03 +02:00
Clément Fournier f06fd8e807 Merge branch 'master' into pr/3293 2021-05-28 12:15:58 +02:00
Denis Borovikov b39ec05970 Fixing the name of the rule 2021-05-27 22:37:53 +01:00
Denis BorovikovandAndreas Dangel fa65ac9f00 Update pmd-java/src/main/resources/category/java/design.xml
Co-authored-by: Andreas Dangel <andreas.dangel@adangel.org>
2021-05-27 22:37:02 +01:00
Denis BorovikovandAndreas Dangel aa3f64d949 Update docs/pages/pmd/languages/java_metrics_index.md
Co-authored-by: Andreas Dangel <andreas.dangel@adangel.org>
2021-05-27 22:36:56 +01:00
Denis BorovikovandAndreas Dangel 5028eaa4a6 Update docs/pages/pmd/languages/java_metrics_index.md
Co-authored-by: Andreas Dangel <andreas.dangel@adangel.org>
2021-05-27 22:36:49 +01:00
Andreas Dangel b3cffd600b Merge branch 'master' into
issue-1438-insufficientstringbufferdeclaration
2021-05-27 18:41:04 +02:00
Andreas Dangel 64e7784333 [doc] Update release notes (pmd/pmd.github.io#12) 2021-05-27 11:04:08 +02:00
Andreas Dangel d481cccdad [doc] Fix javadoc links in release notes 2021-05-27 10:43:02 +02:00
Andreas DangelandArtem Krosheninnikov 15d5a98307 Fix typo in javadoc
Co-authored-by: Artem Krosheninnikov <artem.krosheninnikov@gmail.com>
2021-05-27 10:36:06 +02:00
Andreas Dangel b37508964b Merge pull request #3260 from oowekyala:deprecate-ThreadSafeReportListener
[core] Deprecate more APIs around PMD's entry point #3260
2021-05-27 10:24:04 +02:00
Andreas Dangel 694a325f00 [doc] Update release notes, update java-api (#3196, #3260) 2021-05-27 10:23:54 +02:00
Andreas Dangel 7a4b0d210d Merge branch 'master' into pr-3260 2021-05-27 09:59:45 +02:00
Andreas Dangel 3040f9ab32 [java] Add new MutableStaticState to quickstart (commented) 2021-05-27 09:59:15 +02:00
Denis Borovikov 25b35043d7 Refactor return result 2021-05-26 19:46:52 +01:00
Denis Borovikov d2af01fcf0 Add newlines 2021-05-26 19:04:27 +01:00
Denis Borovikov 0eaf9b712c Fix imports 2021-05-26 19:03:25 +01:00
Denis Borovikov 4967e95a74 Handle nested method for recursion case 2021-05-26 19:00:58 +01:00
Denis Borovikov 68b5cfbded Store the node directly instead of qualified name 2021-05-26 17:53:34 +01:00
Denis Borovikov 0e49ec8889 Use qualified names for methods 2021-05-26 17:31:04 +01:00
Clément Fournier eadbadd2cc Simplify handling of if statements 2021-05-26 13:45:24 +02:00
Denis Borovikov e0e4e7c332 Simplify condition 2021-05-26 12:19:49 +01:00
Denis Borovikov 31e8e58cd7 Rename flag to make it more consistent 2021-05-26 12:17:18 +01:00
Denis Borovikov d1a0a2f34a Add rule test 2021-05-26 11:51:31 +01:00
Denis Borovikov cc512ace57 Revert "Remove forgotten file"
This reverts commit 2a4b53574c.
2021-05-26 11:42:25 +01:00
Denis Borovikov 992ef3b2e3 Reformat file 2021-05-26 11:41:18 +01:00
Denis Borovikov ec60e3e6e0 Fix violation 2021-05-26 11:37:01 +01:00
Denis Borovikov 2a4b53574c Remove forgotten file 2021-05-26 11:29:03 +01:00
Denis Borovikov bbf846375b Refactor code to make it closet to the spec 2021-05-26 11:26:01 +01:00
Denis Borovikov 7ab0bbe2ad Numerous bugfixes 2021-05-26 11:11:26 +01:00
Denis Borovikov f5092765df Add docs 2021-05-25 22:25:02 +01:00
Andreas Dangel 993ae828cf [doc] Update release notes (#3247, #3239) 2021-05-25 19:21:29 +02:00
Andreas Dangel a8f5a710a4 Merge pull request #3246 from vszholobov:visibleStaticFieldsMustBeFinal
[java] New Rule: MutableStaticState #3246
2021-05-25 19:18:46 +02:00
Andreas Dangel e0be13ab8b [doc] Update release notes (#2987, #3246) 2021-05-25 19:18:28 +02:00
Andreas Dangel da36bb38a9 Merge branch 'master' into pr-3246 2021-05-25 19:11:09 +02:00
Clément Fournier e69855c69d Merge branch 'pr/3247' 2021-05-25 13:12:57 +02:00
Clément Fournier 4048b67dd7 Update release notes 2021-05-25 13:12:12 +02:00
Clément Fournier d33eab202f Merge branch 'master' into pr/3247 2021-05-25 13:05:12 +02:00
Clément Fournier 9064cdf8cb Merge branch 'pr/3289' 2021-05-25 12:43:41 +02:00
Clément Fournier 1e4ab03b8d Merge branch 'master' into pr/3289 2021-05-25 12:43:25 +02:00
Clément Fournier ed64f11188 Merge branch 'pr/3290' 2021-05-25 12:42:32 +02:00
Clément Fournier d9a767fae8 Merge branch 'master' into pr/3290 2021-05-25 12:42:22 +02:00
Denis Borovikov ec22c2f41f Fix test 2021-05-24 21:19:13 +01:00
Denis Borovikov c29ff91d8e Re-arrange tests 2021-05-24 20:30:38 +01:00
Denis Borovikov ad9a422240 Refactor classes accordingly to review comments 2021-05-24 13:37:09 +01:00
Denis Borovikov 3de7481f36 Java Cognitive Complexity rule 2021-05-23 20:00:00 +01:00
Andreas Dangel 12ec6d60af Merge pull request #3242 from adangel:issue-699-upgrade-rhino-java8
[javascript] Update Rhino library to 1.7.13 #3242
2021-05-21 11:03:22 +02:00
Andreas DangelandClément Fournier a64077f10c Apply suggestions from code review
Co-authored-by: Clément Fournier <clement.fournier76@gmail.com>
2021-05-21 11:00:48 +02:00
Andreas Dangel c2c26cbbb7 [java] Deprecate rule DefaultPackage
Fixes #3206
2021-05-21 10:57:35 +02:00
Andreas Dangel ce8378b5bf [java] Deprecate rule CloneThrowsCloneNotSupportedException
Fixes #3112
2021-05-21 10:12:43 +02:00
Andreas Dangel 0dab8818af Update gems 2021-05-20 14:26:47 +02:00
Andreas Dangel 0311101d0e [ci] Update DANGER_GITHUB_API_TOKEN 2021-05-20 14:07:43 +02:00
Andreas Dangel 981afbf43a Merge pull request #3272 from YodaDaCoda:master
[apex] correction for ApexUnitTestMethodShouldHaveIsTestAnnotation false positives #3272
2021-05-20 13:40:12 +02:00
Andreas Dangel 3511ef2cb7 [doc] Update release notes (#3183, #3272) 2021-05-20 13:39:51 +02:00
William Brockhus 649f62409d chore: rename is->has 2021-05-19 12:04:21 +10:00
William Brockhus 14a796ba0f fix: add test for false-positive on @TestSetup 2021-05-19 11:58:43 +10:00
William Brockhus d6dff2ee4b fix: use xpath 2.0 2021-05-19 11:58:05 +10:00
Andreas Dangel 89b15cb995 Merge pull request #3279 from oowekyala:issue2639-mkdirs
[core] Fix #2639, create report file directories if they do not exist
2021-05-18 19:53:38 +02:00
William Brockhus ecbb57cdea fix: rename ambiguous isTestMethod function 2021-05-18 09:48:06 +10:00
William Brockhus 291a27cf73 fix: update a failing test due to new isTestMethod 2021-05-18 09:48:06 +10:00
William Brockhus cf39de85b2 feat: rewrite rule as xpath 2021-05-18 09:48:06 +10:00
William Brockhus 4b2457a307 feat: add isTestMethod to ASTModifierNode 2021-05-18 09:48:06 +10:00
William Brockhus 738aca9744 fix: update test for false positives 2021-05-18 09:48:06 +10:00
William Brockhus f80a53186f chore: case sensitivity, update docs 2021-05-18 09:48:06 +10:00
William Brockhus 9a7933b6d7 fix: remove unused imports 2021-05-18 09:48:06 +10:00
William Brockhus b202472ca0 fix: check for deprecated testmethod
Instead of checking methods in a test class that have system.assert, which gives false positives, check for the presence of the testmethod modifier.
2021-05-18 09:48:06 +10:00
Vsevolod 01b572c99a Rename MutableStaticState class to MutableStaticStateTest
Change description to make it more soft and add reasoning why
the non-private static non-final fields should be made
constants or immutable references.
2021-05-17 14:12:15 +07:00
Arnaud Jeansen 9e4ea58518 Ignore private modifiers for both methods and inner classes 2021-05-17 09:03:00 +02:00
Andreas Dangel e838d257a5 [java] InsufficientStringBufferDeclaration - fix false positive
When StringBuilder is used as a formal parameter, we
can't know the capacity.
2021-05-14 22:41:46 +02:00
Andreas Dangel 8ad3e9d742 Merge branch 'master' into
issue-1438-insufficientstringbufferdeclaration
2021-05-14 20:40:38 +02:00
Andreas Dangel e117a5d869 [java] InsufficientStringBufferDeclaration - fix more issues
- correct handling of appending a long value
- correct parsing when reassigning string builder and chaining
  append calls
- correct capacity calculation when initialized with a string
  constant
2021-05-14 20:31:49 +02:00
Clément Fournier dde7b19f97 Add test for #2642
Was fixed by c0eba42f29
in pmd 6.27.0 (bisected)
2021-05-14 19:38:17 +02:00
Clément Fournier 0294083874 Update release notes, refs #3279 2021-05-14 18:50:08 +02:00
Clément Fournier 23e101f62a Update docs 2021-05-14 17:45:09 +02:00
Clément Fournier e54c4dc366 Fix #2639
Tests are in pmd core, current cli tests
are only in pmd-java unfortunately.
2021-05-14 17:42:16 +02:00
Clément Fournier 53e4515e5e Merge branch 'pr/3249'
Refs #3249
2021-05-14 16:53:32 +02:00
Clément Fournier 53bba780c3 Merge branch 'pr/3274' 2021-05-14 16:51:13 +02:00
Clément Fournier 2c5e58330a Merge branch 'pr/3275' 2021-05-14 16:47:40 +02:00
Clément Fournier ec8e977f2c Fix release notes 2021-05-14 16:47:31 +02:00
Clément Fournier 514c1a8561 Merge branch 'master' into pr/3275 2021-05-14 16:46:54 +02:00
Clément Fournier db41beab9e Merge branch 'pr/3261'
Refs #3261
2021-05-14 16:44:47 +02:00
Clément Fournier 6d1e2e037f Merge branch 'pr/3268'
Refs #3268
2021-05-14 16:43:37 +02:00
Clément Fournier 2137cf4b80 Merge branch 'master' into constructorcallsoverridablemethod-fix-IOOBE 2021-05-14 16:43:07 +02:00
Clément Fournier 3fe003bd5b Merge branch 'pr/3255'
Refs #3255
2021-05-14 16:39:25 +02:00
Andreas Dangel 899f80de6c [java] InsufficientStringBufferDeclaration fix FP (#1438)
Fixes false positive for initial calculated StringBuilder size.
If possible, the literals are calculated. If there are method
calls or variables access, then no attempt is made to calculate
the initial size.

Also recognized now ensureCapacity in addition to setLength.

Fixes #1438
2021-05-14 11:40:11 +02:00
Andreas Dangel 00418c1a8d Update pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/rule/codestyle/xml/OnlyOneReturn.xml 2021-05-13 19:26:35 +02:00
Andreas Dangel 45098b801e [doc] Update release notes (#3275) 2021-05-13 19:24:17 +02:00
Andreas Dangel b9550a1488 [java] UnnecessaryLocalBeforeReturn - fix FN with lambda and anon class
The rule uses rule chain now, so that each return is visited,
also in lambdas and anonymous classes.

This FN has been found via #2687.

[skip ci]
2021-05-13 19:17:45 +02:00
Andreas Dangel ebdbec7a1b [java] OnlyOneReturn - fix FN with anonymous class
Converts this rule to use rulechain. Now all method
declarations are visited regardless where they are
nested.

This FN has been found via #2687.
2021-05-13 19:02:20 +02:00
Andreas Dangel 7c2fffb3ee [doc] AvoidReassigningParameters - improve rule doc
Fixes #2219
2021-05-13 15:19:31 +02:00
Andreas Dangel 5fceb94462 [java] AvoidReassigningParameters - report only one violation per param 2021-05-13 15:01:10 +02:00
Andreas Dangel d2db4ba053 Merge branch 'master' into issue-3254-avoidreassigningparameters 2021-05-13 14:51:05 +02:00
Andreas Dangel 9c7286bcf2 Merge pull request #3264 from oowekyala:issue2780-doc-DataClass
[java] Fix #2780 DataClass example from documentation results in false
negative
2021-05-10 19:33:28 +02:00
Andreas Dangel 558a4056eb Merge pull request #3263 from
oowekyala:issue1175-UnusedPrivateMethod-MethodSource

[java] Fix #1175 - UnusedPrivateMethod FP with Junit 5 @MethodSource
2021-05-10 19:20:33 +02:00
Arnaud Jeansen 76af096687 PR review: add expected line numbers 2021-05-10 09:41:45 +02:00
Vsevolod dfcf0d01ca Rename StaticFieldMustBeFinal rule to MutableStaticState
Move MutableStaticState from security to design.

Change description to clarify what "visible field" is.

Change "since" attribute from 6.34.0 to 6.35.0.

Add AssignmentToNonFinalStatic rule reference.
2021-05-10 13:00:52 +07:00
Clément Fournier dca0bf9545 Merge branch 'master' into fix-NPE-methodtyperesolution 2021-05-09 13:45:43 +02:00
Clément Fournier df39bc0688 Test removeSurrounding 2021-05-09 13:10:26 +02:00
Clément Fournier 5e850c0584 Merge branch 'pr/3243'
Refs #3243
2021-05-09 12:12:37 +02:00
Clément Fournier 9740e261ae Merge branch 'master' into pr/3243 2021-05-09 12:12:22 +02:00
Andreas Dangel 8208dc9cd6 Merge pull request #3259 from
oowekyala:issue2737-doc-SwitchStmtsShouldHaveDefault

[java] Fix misleading rule message on rule SwitchStmtsShouldHaveDefault
with non-exhaustive enum switch
2021-05-08 19:51:44 +02:00
Andreas Dangel a3bbbe6e8f Merge pull request #3258 from oowekyala:issue2466-batch-dist
[dist] Include all batch scripts in distribution archive
2021-05-08 19:39:28 +02:00
Andreas Dangel c757369268 Merge pull request #3257 from
oowekyala:issue3248-doc-SingletonClassReturningNewInstance

[java] Fix #3248 - doc of SingletonClassReturningNewInstance
2021-05-08 19:33:06 +02:00
Andreas Dangel 96e9b46b81 Merge pull request #3256 from oowekyala:issue3236-literalsFirstInComparison-and-constants
[java] Fix LiteralsFirstInComparison ignoring constants
2021-05-08 19:28:00 +02:00
Andreas Dangel 03cb11660e Merge pull request #3237 from oowekyala:issue3205-CompareObjectsWithEquals-and-constants
[java] Improve CompareObjectsWithEquals #3237
2021-05-08 18:54:42 +02:00
Andreas Dangel 3f11c5b4de Merge branch 'master' into pr-3237 2021-05-08 18:54:31 +02:00
Andreas Dangel c80b6633d7 [doc] Update release notes (#3237, #3110, #3205) 2021-05-08 18:53:48 +02:00
Andreas Dangel d4789e17c5 [doc] Update release notes, refs #3269 2021-05-07 16:33:49 +02:00
Andreas Dangel d444f30ee4 [ci] Add gradle cache 2021-05-07 16:19:26 +02:00
Andreas Dangel d7b01ced47 [java] Catch TypeNotPresentExceptions, fix NPE in MethodTypeResolution 2021-05-07 16:19:22 +02:00
Andreas Dangel 4fcbdbb248 [doc] Update release notes, refs #3268 2021-05-07 16:18:06 +02:00
Andreas Dangel b1e7bc1c9c [java] ConstructorCallsOverridableMethod - Fix index out of bounds
exception with annotations
2021-05-07 16:17:35 +02:00
Arnaud Jeansen ee691efaf8 Fix JUnit5 interfaces and add more UTs 2021-05-07 14:29:34 +02:00
Clément Fournier 33e1cbcf71 Merge branch 'master' into apex-find-boundary-rulechain 2021-05-07 13:06:44 +02:00
Clément Fournier bf10745ade Merge branch 'pr/3262'
Refs #3262
2021-05-07 12:31:47 +02:00
Clément Fournier abc86702a2 Merge branch 'master' into pr/3262 2021-05-07 12:31:35 +02:00
Clément Fournier a99dfdb41b Merge branch 'pr/3265' 2021-05-07 12:12:22 +02:00
Clément Fournier 471a41eff1 Merge branch 'pr/3266'
Refs #3266
2021-05-07 12:10:00 +02:00
Andreas Dangel db244b0e3b [doc] Update release notes, refs #3266 2021-05-06 15:49:29 +02:00
Andreas Dangel 68c2b9954e [java] LocalVariableCouldBeFinal - fix FN with interfaces, anon classes 2021-05-06 15:44:33 +02:00
Andreas Dangel d3c1dbeb47 [doc] Update release notes, refs #3265 2021-05-06 15:40:47 +02:00
Andreas Dangel 150fec0f6f [java] AvoidReassigningLoopVariables - add more test cases 2021-05-06 15:32:09 +02:00
Andreas Dangel d48cee2258 [java] MethodArgumentCouldBeFinal - fix FN with interfaces 2021-05-06 15:31:43 +02:00
Clément Fournier e73b5484a0 Fix #2780 DataClass example from documentation results in false negative 2021-05-06 15:02:12 +02:00
Clément Fournier a33f5fc82b Release notes 2021-05-06 14:57:30 +02:00
Andreas Dangel 0211a2897c [doc][skip ci] Update release notes, refs #3262 2021-05-06 14:56:06 +02:00
Andreas Dangel ea35221739 [java] FieldDeclarationsShouldBeAtStartOfClass - FN with anon classes 2021-05-06 14:51:31 +02:00
Clément Fournier ddde7cf484 Fix #1175 - UnusedPrivateMethod FP with Junit 5 @MethodSource 2021-05-06 14:48:21 +02:00
Andreas Dangel 5b67d0ead8 [java] Minor rulechain usage fixes
These are in rules, that are not really in use, so shouldn't
have any effect.
2021-05-06 14:21:56 +02:00
Clément Fournier edf5068019 Add StatusCode enum 2021-05-06 14:10:08 +02:00
Clément Fournier 0669154d1f Add API to parse parameters 2021-05-06 14:10:08 +02:00
Clément Fournier 48ad0d35f4 More doc 2021-05-06 14:10:08 +02:00
Clément Fournier 6216156a9c Doc for LanguageVersion, deprecate constructor as internal 2021-05-06 14:10:08 +02:00
Clément Fournier 0562ff7dac Deprecate ThreadSafeReportListener 2021-05-06 14:10:08 +02:00
Clément Fournier 6c9ae9b837 Typo 2021-05-06 14:08:39 +02:00
Clément Fournier 07141d87c3 Release notes 2021-05-06 14:07:20 +02:00
Clément Fournier 223b4e6efe Improve doc of SwitchStmtsShouldHaveDefault, fix #2737 2021-05-06 14:06:28 +02:00
Clément Fournier adc962b7f2 Release notes 2021-05-06 13:56:18 +02:00
Clément Fournier fdf3e5cb03 Fix #2466 include all batch scripts in archive 2021-05-06 13:54:48 +02:00
Clément Fournier 24606d59e2 Release notes 2021-05-06 13:49:14 +02:00
Clément Fournier 102636dfc2 Release notes 2021-05-06 13:48:05 +02:00
Clément Fournier 6beefe5580 Fix #3248 - doc of SingletonClassReturningNewInstance 2021-05-06 13:45:55 +02:00
Clément Fournier 7d150523c3 Remove catch NPE 2021-05-06 13:37:54 +02:00
Clément Fournier 4c81293163 Fix #3236 2021-05-06 13:29:33 +02:00
Clément Fournier d69325f03a Merge branch 'pr/3241'
Refs #3241
2021-05-06 12:51:40 +02:00
Clément Fournier d84b560c82 Merge branch 'master' into pr/3241 2021-05-06 12:51:27 +02:00
Andreas Dangel 9725409daa [java] AvoidReassigningParameters reports violations on wrong line
numbers

Fixes #3254
2021-05-06 11:08:43 +02:00
Andreas Dangel 945c030d7f Bump checkstyle from 8.30 to 8.42 2021-05-06 10:25:55 +02:00
Andreas Dangel b73afc47f7 Bump build-tools from 11 to 12 2021-05-06 10:25:28 +02:00
Andreas Dangel c2955e3aa9 Update gems
Fixes CVE-2021-28965
https://github.com/advisories/GHSA-8cr8-4vfw-mr7h
2021-05-06 10:12:13 +02:00
Arnaud Jeansen bee6e3a2bc PR review: merge parts of the rule 2021-05-05 20:44:54 +02:00
Arnaud Jeansen c1b537247a Make rule report error on the method declaration
rather than the body declaration
2021-05-04 21:41:00 +02:00
Arnaud Jeansen a37f4581a8 PR review
Tweak descriptions, add unit test for Junit4...
2021-05-04 21:22:40 +02:00
Andreas Dangel a8da3d5347 [doc] Update release notes, rule doc for AvoidFieldNameMatchingTypeName
- refs #3249
2021-05-04 19:58:33 +02:00
Andreas Dangel 7648b85bf3 [java] AvoidFieldNameMatchingTypeName fix FN with interfaces
Fields in interfaces and nested classes have not been considered.
2021-05-04 19:49:53 +02:00
Arnaud Jeansen 6f11a61b4b Fix example in rule 2021-05-04 18:37:16 +02:00
Arnaud Jeansen 345f9bfd93 Fix build
AFAICT the site is generated from the XML rule file, so simply add an externalInfoUrl that points at where the rule should end up.

Also put in the correct since date.
2021-05-04 13:22:07 +02:00
Arnaud Jeansen bdf056e96d issue 3239 Implement best practice rule 'JUnit5TestShouldBePackagePrivate'
Add the rule to check that JUnit5 tests methods and classes are package
private.
Add unit tests
2021-05-04 12:54:32 +02:00
Vsevolod fdb1420c5d #2987 New Rule: Public and protected static fields must be final 2021-04-30 19:47:03 +07:00
Clément Fournier f587b7f5f2 Explain FP & FN in issue template description 2021-04-30 12:25:55 +02:00
Clément Fournier e52ea514f3 Merge branch 'pr/3240'
Refs #3240
2021-04-30 11:36:20 +02:00
Andreas Dangel 103e5b27f5 [doc] Update release notes, refs #3243 2021-04-29 17:04:48 +02:00
Andreas Dangel 48c8654f3b [apex] Correct findBoundary when traversing AST
FindBoundary was not considered yet in Apex. That means, that
`node.findDescendantsOfType(ASTVariableExpression.class)` found
variables usages within the current class and within any nested
class.

Now the nested classes are not considered by default. Rules that
make use of rulechain for ASTUserClass will visit both classes.
Rules, that use a standard visitor, need to call `super.visit(...)`
when visiting ASTUserClass. Note that this applies for all root nodes
ASTUserClass, ASTUserEnum, ASTUserInterface, ASTUserTrigger.

Some rules are fixed to use rulechain.
2021-04-29 17:00:57 +02:00
Andreas Dangel 1081448e5d [pmd-dist] Exclude javascript in java7 AllRules integration test 2021-04-29 15:13:04 +02:00
Andreas Dangel 16e70bd8f6 [javascript] Fix unit tests 2021-04-29 15:08:47 +02:00
Andreas Dangel cab260ed22 [javascript] Update Rhino library to 1.7.13
*   Convert pmd-javascript to a java8 module
*   Fixes #699
*   Fixes #2081
2021-04-29 15:01:48 +02:00
Andreas Dangel 6e750bf927 [java] UnnecessaryImport false positive for on-demand imports
Fixes #2655
2021-04-29 11:35:15 +02:00
Andreas Dangel e7ebae1cea Improve issue templates 2021-04-29 10:53:41 +02:00
Andreas Dangel 4250130e94 Not bumping commons-io from 2.6 to 2.7
commons-io 2.7 would require java8.
The risk for https://github.com/advisories/GHSA-gwrp-pvrq-jmwv
(CVE-2021-29425) is tolerable here.

FilenameUtils.normalize is only used in tests or
while generating the ruledoc in module pmd-doc.
2021-04-29 10:33:43 +02:00
Andreas Dangel b1cf527ac6 [doc] Remove editme button for language index pages
Fixes #3230
2021-04-29 10:02:57 +02:00
Clément Fournier eb89176ff8 [java] Enhance CompareObjectsWithEquals with list of exceptions #3110 2021-04-27 23:08:40 +02:00
Clément Fournier dd3a8a3514 [java] Make CompareObjectWithEquals allow comparing against constants #3205
Implementation strategy is to look for all caps name.
Resolving the symbol to know if the field is constant
or not may be done in pmd 7 (the rule is a Java rule there).
2021-04-27 22:57:03 +02:00
Andreas Dangel f62f97f832 [doc] Fix old release notes 2021-04-24 18:39:59 +02:00
Andreas Dangel 375e7a1bff [ci] Improve caching for pmd-regression-tester 2021-04-24 18:01:17 +02:00
Andreas Dangel 8489f8c4d6 [ci] Don't run unnecessary build during release 2021-04-24 18:00:54 +02:00
Andreas Dangel 32275c3eeb Bump pmd from 6.33.0 to 6.34.0 2021-04-24 17:51:24 +02:00
Andreas Dangel 4c21e4069d [ci] Fix paths on sourceforge
The artifacts where uploaded to the wrong path.
That's maybe the reason, why selecting the default download
failed during the release.
2021-04-24 17:19:30 +02:00
Andreas Dangel 814a62a422 Prepare next development version 2021-04-24 16:42:58 +02:00
Andreas Dangel 319900cd43 [maven-release-plugin] prepare for next development iteration 2021-04-24 16:41:17 +02:00
Andreas Dangel bfeaa1b377 [maven-release-plugin] prepare release pmd_releases/6.34.0 2021-04-24 16:41:10 +02:00
Andreas Dangel 75d3c9b3b0 Prepare pmd release 6.34.0 2021-04-24 16:29:47 +02:00
Andreas Dangel 4b4af8c12f [ci] Increase fetch depth for git-repo-sync 2021-04-24 16:15:09 +02:00
Andreas Dangel 16311c65ee Merge pull request #3220 from adangel:build-scripts-update
[ci] Upgrade build scripts #3220
2021-04-23 22:18:34 +02:00
Andreas Dangel a7bd76e866 Merge pull request #3234 from jonathanwiesel:count-is-crud-checkable
[apex] ApexCRUDViolation: COUNT is indeed CRUD checkable since it exposes data (false-negative) #3234
2021-04-23 14:32:38 +02:00
Andreas Dangel dab1d3b7b3 [doc] Update release notes, refs #3234, refs #3202 2021-04-23 14:32:29 +02:00
Andreas Dangel 9937aed5dc Update gems, use pmdtester 1.1.2 2021-04-23 11:51:52 +02:00
Jonathan Wiesel 8e224ed32b [apex] COUNT is CRUD checkable 2021-04-23 11:26:17 +02:00
Andreas Dangel 1985f72d2a Merge pull request #3211 from jonathanwiesel:no-assume-apex-getter-vf
[apex] ApexCRUDViolationRule: Do not assume method is VF getter to avoid
CRUD checks #3211
2021-04-23 09:25:00 +02:00
Andreas Dangel 4566b23e6b [doc] Update release notes, refs #3210, refs #3211 2021-04-23 09:23:56 +02:00
Andreas Dangel 6f8c7e3940 [apex] Document new behavior of ApexCRUDViolation 2021-04-23 09:23:51 +02:00
Andreas Dangel 6730371da2 [ci] stop early for invalid maven version and branch/tag combination 2021-04-22 14:44:23 +02:00
Andreas Dangel b678af113b [doc] Add info about sonarcloud and coveralls 2021-04-22 12:21:40 +02:00
Andreas Dangel 2d5fc019ac Merge branch 'master' into build-scripts-update 2021-04-22 11:10:24 +02:00
Andreas Dangel fe9bf3c352 Bump build-tools from 10 to 11 2021-04-22 10:59:51 +02:00
Andreas Dangel 0741275505 [doc] Add checklist for release process 2021-04-22 10:45:45 +02:00
Andreas Dangel d4a605d099 [doc] Update release process documentation 2021-04-22 10:28:11 +02:00
Andreas Dangel 27f1ca47a3 [doc] Add new infrastructure page 2021-04-20 19:18:14 +02:00
Andreas Dangel fc1ef8e45c Merge pull request #3214 from adangel:funding
Add FUNDING.yml #3214
2021-04-19 19:54:44 +02:00
Andreas Dangel 50c553ec1c Merge pull request #3226 from oowekyala:issue3169-checkResultSetNpe
[java] Fix #3169 - NPE in CheckSkipResult #3226
2021-04-19 19:53:22 +02:00
Andreas Dangel f0d2aa5514 Merge pull request #3225 from oowekyala:issue3224-unusedAssignmentCrash
[java] Fix #3224 - UnusedAssignment crashes with nested records #3225
2021-04-19 19:52:30 +02:00
Andreas Dangel 20131fb736 [doc] Update release notes, refs #3224 2021-04-19 19:51:21 +02:00
Andreas Dangel 882efd923e Merge pull request #3200 from oowekyala:deprecate-DuplicateImports-ImportsFromSamePackage
[java] Replace import rules with new rule UnnecessaryImport #3200
2021-04-19 19:49:36 +02:00
Andreas Dangel a6a3db43b0 [doc] Fix release notes - the new rule is UnnecessaryImport 2021-04-19 19:49:24 +02:00
Andreas Dangel 47169f23d3 [doc] Update rule doc references for new UnnnecessaryImport 2021-04-19 19:37:27 +02:00
Andreas Dangel 235e55a4bb [doc] Update release notes, refs #3200, refs #3128 2021-04-19 19:36:57 +02:00
Clément Fournier e7603c1e03 Update release notes, refs #3169, #3226 2021-04-18 20:26:29 +02:00
Andreas Dangel a09e38471f [ci] Run git-repo-sync only on pushes, not on pull requests
Also remove unneeded actions
2021-04-18 19:57:50 +02:00
Andreas Dangel 2ad755f963 [ci] Add git-repo-sync 2021-04-18 19:50:52 +02:00
Andreas Dangel 5f0dc5baaa [ci] Fix shellcheck issues in do-release.sh 2021-04-18 19:25:28 +02:00
Andreas Dangel 381395d13f [ci] Create a news entry on sourceforge when releasing 2021-04-18 19:08:51 +02:00
Andreas Dangel f413328653 [ci] Set autoReleaseAfterClose=true in workflow 2021-04-18 18:49:14 +02:00
Andreas Dangel dc56e6eed6 [ci] Move doc to pmd/build-tools 2021-04-18 16:57:52 +02:00
Andreas Dangel 4241c3713c [ci] Document how to test a release push build 2021-04-18 16:54:43 +02:00
Clément Fournier 5118e257c8 Fix #3169 - NPE in CheckResultSet 2021-04-18 15:46:42 +02:00
Clément Fournier 10fef19152 Fix #3224 - UnusedAssignment crashes with nested records 2021-04-18 15:37:17 +02:00
Andreas Dangel 953a9999b4 [ci] Checkout with fetch-depth 2
Otherwise we can't fetch later more commits
for regression-tester and danger.
2021-04-16 20:06:56 +02:00
Andreas Dangel 081edd5213 Revert "[ci] Enable debug mode for check-environment.sh"
This reverts commit ff68dd7bef.
2021-04-16 16:43:28 +02:00
Andreas Dangel ff68dd7bef [ci] Enable debug mode for check-environment.sh 2021-04-16 16:35:52 +02:00
Andreas Dangel 6fda9ad8ed [ci] Remove unnecessary MAVEN_OPTS 2021-04-16 16:00:59 +02:00
Andreas Dangel 5fd66c0e77 [ci] Remove old docker config
The docker from pmd/build-tools should be used instead.
2021-04-16 15:59:57 +02:00
Andreas Dangel f2e20ec963 [ci] Update docs for testing the builds 2021-04-16 15:57:45 +02:00
Andreas Dangel 6af30afb01 [ci] Fix java7.home path 2021-04-16 09:53:38 +02:00
Andreas Dangel 6e57cc5563 [ci] Update docs for testing the builds 2021-04-15 19:29:22 +02:00
Andreas Dangel c1f307eb0b [ci] Update doc about pmd build 2021-04-15 18:47:44 +02:00
Andreas Dangel b896aacabf [ci] Move render_release_notes.rb to docs 2021-04-15 18:20:26 +02:00
Andreas Dangel c384bb8732 [ci] Fix shellcheck issues 2021-04-15 18:16:32 +02:00
Andreas Dangel 640b3fcab3 [ci] Fix shellcheck issues 2021-04-15 16:44:17 +02:00
Andreas Dangel 417cc7fcbe [ci] Finish scripts migration, integration sonar+coveralls 2021-04-15 16:20:22 +02:00
Andreas Dangel 10c6906f0f [ci] First round of migration to new build scripts 2021-04-15 15:26:33 +02:00
Andreas Dangel ab416a19ff Bump dokka from 1.4.10.2 to 1.4.30
Remove workaround for Kotlin/dokka#1644
2021-04-15 14:23:16 +02:00
Andreas Dangel 3989c080f3 [java] Update rule doc for UseVarArgs, refs #3182 2021-04-15 10:27:38 +02:00
Andreas Dangel 5b8c156047 Bump maven from 3.6.3 to 3.8.1 2021-04-15 09:20:48 +02:00
Andreas Dangel c2ae8b19c2 Add FUNDING.yml 2021-04-12 19:26:46 +02:00
Clément Fournier 02169557b0 Merge DontImportJavaLang into the new rule 2021-04-12 18:05:45 +02:00
Clément Fournier ea55a80f53 Update release notes 2021-04-12 17:38:54 +02:00
Clément Fournier 8e20841ab2 Deprecate UnusedImports 2021-04-12 17:36:09 +02:00
Clément Fournier d096e6021d Revert changes to UnusedImports 2021-04-12 17:33:27 +02:00
Clément Fournier 77e3c19cb2 Create rule UnnecessaryImport 2021-04-12 17:18:32 +02:00
Clément Fournier 99cc370a96 Merge branch 'master' into deprecate-DuplicateImports-ImportsFromSamePackage 2021-04-12 17:12:29 +02:00
Jonathan Wiesel c453f5c936 Deleting unused import 2021-04-11 00:24:50 +02:00
Jonathan Wiesel c4b1d9db90 Do not assume method is VF getter and enforce CRUD 2021-04-10 22:23:54 +02:00
Andreas Dangel 92e4631fc2 Merge pull request #3198 from
jonathanwiesel:more-apex-operations-with-limits-in-loops

[apex] OperationWithLimitsInLoopRule: Support more limit consuming
static method invocations #3198
2021-04-10 19:24:25 +02:00
Andreas Dangel a23fa44028 [doc] Update release notes, refs #3198 2021-04-10 19:23:35 +02:00
Andreas Dangel a55f760d7d Merge pull request #3197 from
oowekyala:issue2757-closeResource-Cleanup-annot

[java] Fix #2757: make CloseResource support @lombok.Cleanup #3197
2021-04-10 19:11:23 +02:00
Andreas Dangel 872b69d62b [doc] Update release notes, refs #2757, refs #3197 2021-04-10 19:10:36 +02:00
Andreas Dangel 13bb5a00bb Merge pull request #3193 from aaime:useStandardCharsets
[java] New rule: UseStandardCharsets #3193
2021-04-10 16:55:42 +02:00
Andreas Dangel 37f35320b5 [doc] Update release notes, refs #3190, refs #3193 2021-04-10 16:55:27 +02:00
Clément Fournier 0726ec9673 Update release notes 2021-04-05 21:55:36 +02:00
Clément Fournier fae74f43b3 Checkstyle 2021-04-05 21:48:05 +02:00
Clément Fournier 45fc45c809 Update rule description and message 2021-04-05 21:42:20 +02:00
Clément Fournier 8420910783 Make UnusedImports recognize imports from same package
Refs #3128
2021-04-05 21:38:42 +02:00
Clément Fournier e9a7097f20 Deprecate rules DuplicateImports, ImportFromSamePackage
Refs #3128
2021-04-05 21:21:51 +02:00
Clément Fournier b77f1d13bd Make UnusedImports report duplicate imports
Refs #3128
2021-04-05 21:19:12 +02:00
Clément Fournier bd912f0cb6 Refactor UnusedImport
Simplify ImportWrapper
2021-04-05 21:07:33 +02:00
Clément Fournier a493b15eb2 Refactor ImportWrapper 2021-04-05 20:41:56 +02:00
Clément Fournier 18c55199b9 Rename test 2021-04-05 18:37:29 +02:00
Clément Fournier cfb6b3d57b CloseResource: Add support for @lombok.Cleanup
Fixes #2757
2021-04-05 18:35:42 +02:00
Jonathan Wiesel 9af635047e Add more limit consuming static method invocations 2021-04-05 18:23:11 +02:00
Clément Fournier 1a095f941b Add test case for #2757 2021-04-05 18:22:49 +02:00
Andrea Aime 3b75c31c28 #3190, UseStandardCharsets, java, new rule. Handling eviewer's feedback 2021-04-05 10:38:20 +02:00
Andrea Aime ab0ccc145c #3190, UseStandardCharsets, java, new rule 2021-04-03 14:58:38 +02:00
Andreas Dangel 81739da5ca Bump com.google.guava:guava from 29.0-android to 30.0-android 2021-04-01 12:02:57 +02:00
Andreas Dangel bbec003287 Update gems 2021-04-01 12:01:18 +02:00
Andreas Dangel 1da26f9e55 [doc] Update gems 2021-04-01 12:00:31 +02:00
Andreas Dangel 41f9815ac8 (dogfood) Bump pmd from 6.32.0 to 6.33.0 2021-03-27 17:38:20 +01:00
Andreas Dangel 033709d671 Prepare next development version 2021-03-27 16:26:41 +01:00
Andreas Dangel 37e5525fd5 [maven-release-plugin] prepare for next development iteration 2021-03-27 16:25:18 +01:00
Andreas Dangel dc1c9d0aed [maven-release-plugin] prepare release pmd_releases/6.33.0 2021-03-27 16:25:13 +01:00
Andreas Dangel 12143c6490 Prepare pmd release 6.33.0 2021-03-27 16:14:50 +01:00
Andreas Dangel afdf876f36 [doc] Update release notes - no API changes 2021-03-27 16:03:48 +01:00
Andreas Dangel ff0e3cceb9 Merge pull request #3147 from adangel:issue-2977-close-resource-reassignment
[java] CloseResource: false positive with reassignment detection #3147
2021-03-27 15:06:36 +01:00
Andreas Dangel 504f31d1c5 [java] CloseResource - refactor to use isVariableAccess 2021-03-27 15:02:50 +01:00
Andreas Dangel 17252cb423 Merge branch 'master' into issue-2977-close-resource-reassignment 2021-03-27 14:47:48 +01:00
Andreas Dangel 5953bb2968 Merge pull request #3151 from adangel:issue-3148-close-resource-if
[java] CloseResource false positive with Objects.nonNull #3151
2021-03-27 14:33:04 +01:00
Andreas Dangel bbac216b3e Merge pull request #3156 from
adangel:issue-3142-apex-excessive-class-length

[apex] ExcessiveClassLength multiple warning on the same class #3156
2021-03-27 14:27:56 +01:00
Andreas Dangel 96a44cec59 Merge pull request #3170 from adangel:issue-3165-invalidlogmessageformat
[java] InvalidLogMessageFormat more String.format detection #3170
2021-03-27 14:13:15 +01:00
Andreas Dangel 0c113dfe52 Merge pull request #3157 from
adangel:issue-3118-unused-private-method-lombok-val

[java] UnusedPrivateMethod false positive when passing in lombok.val as
argument #3157
2021-03-27 14:11:47 +01:00
Andreas Dangel fdc6336bf2 [ci] Increase timeout for staging to oss.sonatype.org 2021-03-26 17:56:26 +01:00
Andreas Dangel d11f1a087a [java] InvalidLogMessageFormat more String.format detection
Fixes #3165
2021-03-26 09:00:00 +01:00
Andreas Dangel d08d1d10e6 Merge pull request #3161 from hvbtup:master
[plsql] Add support for lexical parameters in SQL*Plus scripts,
allow excluding lines which the parser does not understand #3161
2021-03-26 08:42:44 +01:00
Andreas Dangel 35790704b4 Merge branch 'master' into pr-3161 2021-03-25 20:00:25 +01:00
Andreas Dangel 813a0b194a [doc] Update release notes, refs #195, refs #3161 2021-03-25 19:59:01 +01:00
Andreas Dangel efbf023648 [plsql] Rework SQLCommand keywords vs. identifiers 2021-03-25 19:49:03 +01:00
Andreas Dangel b35f22d4e0 Fix pmd warning 2021-03-25 16:51:43 +01:00
Andreas Dangel a5478c7358 [plsql] Document PMD Exclusions 2021-03-25 16:44:54 +01:00
Andreas Dangel 90675d9df0 [plsql] Move ParsingExclusion to internal package 2021-03-25 16:26:38 +01:00
Andreas Dangel 595ab39015 [plsql] Move ParsingExclusion test to PlsqlTreeDumpTest 2021-03-25 16:14:12 +01:00
Andreas Dangel f77608899f [plsql] Add test for #195 - SqlPlus lexical variables 2021-03-25 16:09:15 +01:00
Andreas Dangel e2307792b4 Bump build-tools from 9-SNAPSHOT to 10 2021-03-25 11:47:08 +01:00
Henning von Bargen 2eb2ce863f Reacted to comments in the PR:Some refactoring 2021-03-22 16:40:41 +01:00
Andreas Dangel 9f4c22d08c Merge pull request #3167 from AustinTice:patch-1
[java] Minor typo in quickstart ruleset #3167
2021-03-21 21:17:58 +01:00
Andreas Dangel 4020c8beb7 [doc] Update release notes, refs #3167 2021-03-21 21:17:45 +01:00
Austin Tice b1086e982c Minor typo
Fixed package name from LoosePackageCouling -> LoosePackageCoupling.
2021-03-20 14:45:11 -05:00
Henning von Bargen 9d66782457 Avoid PMD warning. 2021-03-12 11:58:37 +01:00
hvbtup 56fed34113 Merge pull request #2 from hvbargen/master
Support for detecting excluded ranges in the top-level Input node
2021-03-12 09:16:45 +01:00
Clément Fournier 342dc1d03a Merge branch 'pr/3155'
Refs #3155
2021-03-10 15:23:06 +01:00
Clément Fournier 833e255526 Merge branch 'master' into pr/3155 2021-03-10 15:22:28 +01:00
Clément Fournier b45ab7698c Fix example syntax 2021-03-10 15:21:13 +01:00
Clément Fournier f1284b91d0 Merge branch 'pr/3154'
Refs #3154
2021-03-10 12:50:14 +01:00
Clément Fournier 7dc879c287 Merge branch 'master' into pr/3154 2021-03-10 12:49:56 +01:00
Clément Fournier bef0d2b848 Merge branch 'pr/3153'
Refs #3153
2021-03-10 12:45:19 +01:00
Clément Fournier ea41b1d556 Merge branch 'master' into pr/3153 2021-03-10 12:45:03 +01:00
Clément Fournier b614ee70cd Merge branch 'pr/3149'
Refs #3149
2021-03-10 12:43:47 +01:00
Clément Fournier a989b68c22 Merge branch 'master' into pr/3149 2021-03-10 12:42:29 +01:00
hvbargen 3040c3461e Support for detecting excluded ranges in the top-level Input node with rules. 2021-03-10 11:36:03 +01:00
Andreas Dangel 1414c83eec [java] MethodReturnsInternalArray does not consider static final fields
and fields initialized with empty array

- Fixes #3160
2021-03-09 19:59:56 +01:00
Henning von Bargen 64dfebf618 Test cases and bug fixes for lexical parameters and exclusion 2021-03-05 17:24:49 +01:00
Clément Fournier d8ddb09b35 Test for #3160 2021-03-05 15:09:29 +01:00
Clément Fournier d884181d04 Merge branch 'pr/3159'
Refs #3159
2021-03-05 11:49:36 +01:00
Clément Fournier d815c5d173 Update grammar changelog 2021-03-05 11:48:05 +01:00
Clément Fournier 24587163c9 Merge branch 'master' into pr/3159 2021-03-05 11:46:59 +01:00
Andreas Dangel 1905ea6d4a Merge pull request #3150 from oowekyala:issue3145-local-record
[java] Fix #3145 - parse exception with local records #3150
2021-03-05 10:15:04 +01:00
Andreas Dangel 3ec49a2b04 [doc] Update release notes (#3145, #3150) 2021-03-05 10:14:51 +01:00
Andreas Dangel 4bfd72e658 [java] Infinite loop when parsing invalid code nested in lambdas
- fixes #3117
- backports part of StatementExpression production from pmd7
2021-03-05 09:58:29 +01:00
hvbtup f07feaf3a1 Merge pull request #1 from hvbargen/master
Add support lexical parameters in SQL*Plus scripts, allow excluding lines which the parser does not understand.
2021-03-05 09:12:08 +01:00
Andreas Dangel 3fb40436fe [java] Add test case for unused private method in nested classes
This is fixed by using rule chain...
2021-03-04 20:22:18 +01:00
Andreas Dangel 3593b4d8b3 [java] UnusedPrivateMethod false positive when passing in lombok.val as
argument

- Fixes #3118
- Is as good as "var", which means, we don't check determine
  the actual type. Could lead to false negatives, when overloaded
  methods are used.
2021-03-04 18:54:12 +01:00
Andreas Dangel 0c16a321dc Fix build under Windows - line endings... 2021-03-04 15:03:40 +01:00
Andreas Dangel 9a6517561e [apex] ExcessiveClassLength multiple warning on the same class
- fixes #3142
2021-03-04 12:47:07 +01:00
Andreas Dangel 18d1612b6b [java] GuardLogStatement: False negative with unguarded method call
- Fixes #3144 (doc update, examples)
- Fixes false negative with method calls as arguments
2021-03-04 11:13:59 +01:00
Andreas Dangel ca89cba25f [java] ConsecutiveLiteralAppends and
InsufficientStringBufferDeclaration: FP with switch expressions

Fixes #3152
2021-03-04 10:20:21 +01:00
Andreas Dangel ac1792959a [java] ConsecutiveLiteralAppend false-positive with builder inside
lambda

Add test case for #2427, already fixed since PMD 6.25.0
2021-03-04 09:52:21 +01:00
Clément Fournier a0e8107249 Fix #3145 - parse exception with local records 2021-03-04 07:48:39 +01:00
Andreas Dangel 86e7cb38cf [java] CloseResource false positive with Objects.nonNull
- fixes #3148
2021-03-03 20:14:06 +01:00
Andreas Dangel 954bcffb94 [java] InvalidLogMessageFormat detection failing when String.format used
- Fixes #3146
2021-03-02 18:36:11 +01:00
Andreas Dangel b942c50631 [java] CloseResource: false positive with reassignment detection
- fixes #2977
2021-03-01 20:13:37 +01:00
Clément Fournier 5650b720b3 Merge branch 'pr/2980'
Refs #2980
2021-03-01 15:42:25 +01:00
Clément Fournier a2d1976db9 Merge branch 'master' into pr/2980 2021-03-01 15:42:08 +01:00
Andreas Dangel be23b6f8aa (dogfood) Bump pmd from 6.31.0 to 6.32.0 2021-02-27 14:04:40 +01:00
Andreas Dangel ad6329faa6 Prepare next development version 2021-02-27 09:47:21 +01:00
Andreas Dangel e0de01ebe9 [maven-release-plugin] prepare for next development iteration 2021-02-27 09:44:05 +01:00
Andreas Dangel 0848e230d0 [maven-release-plugin] prepare release pmd_releases/6.32.0 2021-02-27 09:43:58 +01:00
Andreas Dangel 6ee8398dd7 Prepare pmd release 6.32.0 2021-02-27 09:32:01 +01:00
Andreas Dangel bae42f954a Fix build 2021-02-26 22:09:43 +01:00
Andreas Dangel 84ea5e04b4 Revert the changes - compare Nodes with == again 2021-02-26 20:59:35 +01:00
Andreas Dangel b03ec450c2 (dogfood) Bump pmd from 6.30.0 to 6.31.0 2021-02-26 20:31:26 +01:00
Andreas Dangel 7384a69d31 Merge branch 'master' into dogfood-6.30.0 2021-02-26 19:26:36 +01:00
hvbargen 46e368a3e0 Allow excluding lines from the parser using comments -- PMD-EXCLUDE-BEGIN and -- PMD-EXCLUDE-END. This is to workaround bugs in the PL/SQL parser - some valid statements cannot be parsed. by wrapping them inside PMD-EXCLUDE-BEGIN/END the parser just ignores them and continues parsing with the next line. 2021-02-26 19:11:27 +01:00
Andreas Dangel b576626e40 Merge pull request #3143 from adangel:issue-3089-property-spaces
[core] Trim property values #3143
2021-02-26 19:08:45 +01:00
Andreas Dangel 93a08052af Merge pull request #3139 from adangel:issue-3132-unused-static-import
[java] UnusedImports with static imports on subclasses (fixes #3132)
#3139
2021-02-26 19:07:00 +01:00
Andreas Dangel 1b5b7b8c87 Merge pull request #3138 from
adangel:issue-3133-invalid-log-message-format

[java] InvalidLogMessageFormat fix FP with StringFormattedMessage and
ParameterizedMessage #3138
2021-02-26 19:05:19 +01:00
Andreas Dangel 519fa61e9b Merge pull request #3137 from adangel:deprecations-for-3116
[java] Deprecation in AvoidUsingHardCodedIPRule #3137
2021-02-26 19:03:12 +01:00
Andreas Dangel c5cc51db98 Merge pull request #3136 from
adangel:issue-2716-compare-objects-with-equals

[java] CompareObjectsWithEqualsRule: False positive with Enums #3136
2021-02-26 19:02:23 +01:00
Andreas Dangel 3bf497cca8 Merge pull request #3135 from adangel:issue-3101-parse-error
[java] NullPointerException when running PMD under JRE 11 (fixes #3101) #3135
2021-02-26 18:59:33 +01:00
Andreas Dangel 350d00cf6d Fix build 2021-02-26 16:17:37 +01:00
Andreas Dangel 27f007cb1f [core] Trim rule property values
- Most single-valued properties are trimmed
- Some types keep whitespaces, e.g. Character and Regex

Fixes #3089
2021-02-26 15:45:07 +01:00
Andreas Dangel 1f73ebc607 [java] Update test for #2977 2021-02-26 14:49:43 +01:00
Andreas Dangel 41076fac1c [doc] Add Artem Krosheninnikov's talk about Quality Assurance Automation 2021-02-26 12:11:18 +01:00
Andreas Dangel 7d54b863d1 [java] Update rule doc of InvalidLogMessageFormat 2021-02-25 19:47:31 +01:00
Andreas Dangel 72b07cfa69 [java] CloseResource - make test sample compilable (#2977) 2021-02-25 18:50:04 +01:00
Andreas Dangel 5cad3c270d Fix NPE for interfaces 2021-02-25 18:24:32 +01:00
Andreas Dangel ad1a210940 Fix compile error 2021-02-25 17:19:05 +01:00
hvbargen 475f750216 Support for common SQL*Plus command abbreviations, support for special characters in HOST, REMARK, REM commands. 2021-02-25 16:30:56 +01:00
Andreas Dangel 861a646d83 [java] UnusedImports with static imports on subclasses (fixes #3132) 2021-02-25 14:56:46 +01:00
hvbargen 387dee88f1 No longer accept arbitrary lines as SQL*Plus commands. 2021-02-25 14:43:09 +01:00
Andreas Dangel 760e868931 [java] InvalidLogMessageFormat fix FP
with StringFormattedMessage and ParameterizedMessage
Fixes #3133
2021-02-25 14:22:30 +01:00
Andreas Dangel ddd8510197 [doc] Fix release notes rendering
Escape "||" to not render a table...
2021-02-25 12:03:46 +01:00
Andreas Dangel 29c56727a6 [java] Deprecation in AvoidUsingHardCodedIPRule
- protected and public members
- refs #3116
2021-02-25 11:57:20 +01:00
Andreas Dangel 7146e588d2 [java] CompareObjectsWithEqualsRule: False positive with Enums
- verifies #2716
2021-02-25 10:26:26 +01:00
Andreas Dangel ba3dbd3d80 [java] NullPointerException when running PMD under JRE 11 (fixes #3101) 2021-02-25 09:36:24 +01:00
hvbargen c4fe303393 Replaced StringBuffer with StringBuilder again 2021-02-24 10:32:19 +01:00
hvbargen 017e40ba67 Accept double ampersand as well 2021-02-24 10:28:24 +01:00
hvbargen fd973e7db5 Basic support for ampersand and backslash characters. At least the parser now accepts these characters and can parse a lot more typical scripts. 2021-02-24 09:48:51 +01:00
Andreas Dangel bb564aeb72 Merge pull request #3125 from arturdryomov:ad/docs-indentation
[doc] Fix sample code indentation in documentation #3125
2021-02-22 20:52:27 +01:00
Andreas Dangel 2cc701fbe7 [doc] Update release notes, refs #3125 2021-02-22 20:52:17 +01:00
Clément Fournier 4ee165c8fe Merge pull request #3111 from adangel/java-16-support
(Java 16 support)
2021-02-19 23:07:38 +02:00
Artur Dryomov ab778259b8 Fix code indentation in documentation 2021-02-19 22:33:12 +03:00
Andreas Dangel a482aa3ae4 Merge branch 'master' into java-16-support 2021-02-19 09:20:09 +01:00
Andreas DangelandClément Fournier 7187e1d451 Apply suggestions from code review
Co-authored-by: Clément Fournier <clement.fournier76@gmail.com>
2021-02-19 09:18:31 +01:00
Andreas Dangel 1d6195cc55 Merge pull request #3115 from oowekyala:gh-actions-cleanup-log
[ci] Stop logging download progress in CI #3115
2021-02-19 09:12:37 +01:00
Andreas Dangel 1a30468d35 Merge pull request #3107 from hvbtup:master
[plsql] Fix ParseException for EXECUTE IMMEDIATE str1||str2; #3107
2021-02-19 09:00:38 +01:00
Andreas Dangel e7c808e1b4 [doc] Update release notes (#3106 #3107) 2021-02-19 08:58:51 +01:00
Andreas Dangel a6f68a8beb Merge pull request #3098 from jonathanwiesel:private_apex_doc
[apex] ApexDoc optionally report private and protected #3098
2021-02-19 08:42:59 +01:00
Andreas Dangel a0b0be35bb [doc] Update release notes (#3075 #3098) 2021-02-19 08:42:47 +01:00
Andreas Dangel 403c5956b8 [doc] Update release notes for Java 16 support 2021-02-16 21:19:22 +01:00
Andreas Dangel 2ec77ad02f [java] Remove support for Java 14 preview 2021-02-15 19:58:55 +01:00
Andreas Dangel 3b151e31c4 [java] JEP 397: Sealed Classes (Second Preview) for Java16 Preview 2021-02-15 19:33:36 +01:00
Andreas Dangel 8bc26f95aa [java] JEP 395: Records for Java16
- Renamed ASTRecordConstructorDeclaration to
  ASTCompactConstructorDeclaration to align naming to JLS
- ASTRecordDeclaration, ASTRecordComponentList, ASTRecordComponent,
  ASTRecordBody, ASTCompactConstructorDeclaration are not
  longer @Experimental
2021-02-14 19:42:59 +01:00
Clément Fournier 19eea5ae31 Use a compiled class instead, refs #2881 2021-02-13 22:26:08 +01:00
Clément Fournier 3195757425 Add test cases for #2881 2021-02-13 22:05:31 +01:00
Clément Fournier 79c1bd74e2 Use batch mode instead 2021-02-13 19:09:20 +01:00
Clément Fournier d0721de473 Make dependency plugin silent as well 2021-02-13 19:05:03 +01:00
Clément Fournier da68997926 Also update build command 2021-02-13 18:54:59 +01:00
Clément Fournier d617c964e7 Do not log download progress in CI 2021-02-13 18:39:11 +01:00
Andreas Dangel 03731f8c16 [java] Remove more @Experimental for ASTTypePattern 2021-02-12 18:05:53 +01:00
Andreas Dangel 64b501e0f4 [java] Rename ASTTypeTestPattern -> ASTTypePattern, remove @Experimental
With JEP 394 / Java16, this production has been renamed.
Pattern Matching for Instanceof is now a standard feature,
therefore the AST node is not experimental anymore.
2021-02-12 12:54:06 +01:00
Andreas Dangel 8c755fabe2 [java] JEP 394: Pattern Matching for instanceof for Java16
The TypePattern now allows the final keyword
and Annotations. Pattern variables are now only
effectively final.
2021-02-12 12:44:08 +01:00
Henning von Bargen ac1b5ed159 Issue 3106: Use StringExpression, test case renamed, moved plsql to resource folder. 2021-02-12 09:48:27 +01:00
Andreas Dangel 87cdd60e39 [java] Add versions 16 and 16-preview, update asm 2021-02-12 09:27:10 +01:00
Jonathan Wiesel 42fda5891a Simplify property access 2021-02-11 10:55:19 +01:00
Jonathan Wiesel 20833c0e78 Change to boolean primitive 2021-02-11 10:55:05 +01:00
Henning von Bargen 34eb080884 Added unit test for issue #3106 2021-02-11 09:02:30 +01:00
Henning von Bargen 64d5ccad78 Fix for issue #3106 ParseException for EXECUTE IMMEDIATE str1||str2; 2021-02-10 17:54:10 +01:00
Clément Fournier 2b6dcb3f22 Change default labels for violation issue template
An issue that has both labels probably needs one of them to be removed.
2021-02-08 19:37:00 +01:00
Andreas Dangel 848ec2e7bb Bump org.apache.ant:ant|ant-testutil from 1.10.8 to 1.10.9
Fixes CVE-2020-11979
2021-02-04 10:13:06 +01:00
Jonathan Wiesel c2e4556360 ApexDoc optionally report private and protected 2021-02-02 12:02:52 +01:00
Andreas Dangel 843336a79a Prepare next development version 2021-01-30 18:05:49 +01:00
Andreas Dangel 2ea0328678 [maven-release-plugin] prepare for next development iteration 2021-01-30 18:04:17 +01:00
Andreas Dangel 7d6e6239c5 [maven-release-plugin] prepare release pmd_releases/6.31.0 2021-01-30 18:04:08 +01:00
Andreas Dangel 52062c739e Prepare pmd release 6.31.0 2021-01-30 17:53:26 +01:00
Andreas Dangel 6ec2fa6fb3 [doc] Update release notes, refs #3088 2021-01-30 12:01:43 +01:00
Andreas Dangel 77cf105ecf Merge pull request #3084 from jfeingold35:d/W-8680425-b
[vf] VfUnescapeEl false-positive with builtin functions #3084
2021-01-30 10:03:53 +01:00
Andreas Dangel 52818edb50 [doc] Update release notes, refs #3084, refs #3081 2021-01-30 10:03:03 +01:00
Joshua Feingold d88d8ff913 @W-8680425@: Added LINKTO back into the list of inherently safe functions. 2021-01-29 10:02:09 -06:00
Andreas Dangel df80080aaa Merge pull request #3073 from CopadoSolutions:include-sarif-renderer
[core] Include SARIF renderer #3073
2021-01-28 09:07:23 +01:00
Andreas Dangel aa9dd8fa16 [doc] Update SARIF standard link 2021-01-28 09:04:24 +01:00
Andreas Dangel 33a8aa384e [doc] Update release notes, refs #2953, refs #3073 2021-01-28 09:01:48 +01:00
Joshua Feingold a4916f94fc @W-8680425@: Pulled out some repeated code into convenience method. 2021-01-25 16:33:47 -06:00
Joshua Feingold c14398d19f @W-8680425@: Refactored escape detection in script context. Multiple false positives resolved. 2021-01-25 14:39:25 -06:00
Clément Fournier aa8524ca4a Add tests for #2207 2021-01-25 14:08:06 +01:00
Manuel Moya 7cb3b68884 PR Comments 2021-01-25 11:28:27 +01:00
Andreas Dangel f8c091b742 Merge pull request #3072 from oowekyala:deprecate-rules-631
[java] Deprecate some performance rules #3072
2021-01-22 12:00:22 +01:00
Andreas Dangel 635cdd75d3 [doc] Update release notes (#2295, #2740) 2021-01-22 11:58:55 +01:00
Andreas Dangel 1a030801f3 Merge pull request #3070 from oowekyala:issue3006-singularfield-npe
[java] Fix NPE in SingularFieldRule with concise resource syntax
2021-01-22 11:51:35 +01:00
Andreas Dangel b0f30e99f6 [doc] Update release notes, refs #3006 2021-01-22 11:50:29 +01:00
Andreas Dangel b6a8e8fe63 Merge pull request #3069 from oowekyala:xml-deprecate-java-rules
[xml] Deprecate xml base rule classes #3069
2021-01-22 11:49:11 +01:00
Andreas Dangel c69f7e96e6 Merge pull request #3066 from oowekyala:java-unused-names
[java] Make unused rules ignore some names #3066
2021-01-22 11:36:29 +01:00
Andreas Dangel 360283fdb6 Merge pull request #3065 from oowekyala:issue2876-ignored-annotation-bug
[java] Fix ignoredAnnotation property in UnusedPrivateField #3065
2021-01-21 18:24:20 +01:00
Andreas Dangel e69af856de [doc] Update release notes, refs #2876 2021-01-21 18:23:31 +01:00
Andreas Dangel 0b2a727aae Merge pull request #3064 from
oowekyala:issue2454-typehelper-trim-whitespace

[java] Fix problem with whitespace in properties #3064
2021-01-21 18:20:05 +01:00
Andreas Dangel a7e02f403d [doc] Update release notes, refs #2454 2021-01-21 18:18:36 +01:00
Andreas Dangel 41151d30e7 Merge pull request #3063 from oowekyala:issue3062-stream-close-resource
[java] Fix CloseResource FP with reassigned stream #3063
2021-01-21 18:05:22 +01:00
Andreas Dangel 2032d8ce5b [doc] Update release notes, refs #3062 2021-01-21 18:03:27 +01:00
Andreas Dangel 8e42f6c9ba Merge pull request #3061 from oowekyala:typeres-fix-method-calls
[java] Fix method calls in type resolution #3061
2021-01-21 18:01:23 +01:00
Andreas Dangel 1050bce2f5 [doc] Update release notes
refs #2976
refs #2977
refs #2979
refs #3004
2021-01-21 18:00:06 +01:00
Andreas Dangel a90b2ea524 [ci] Exclude generated sources for regression tester 2021-01-21 17:57:03 +01:00
Andreas Dangel a34ae3eea1 [ci] Compile tests of spring framework for regression tester
The test classes have not been compiled, that's why the typeres
can't always resolve the classes.
2021-01-21 16:56:19 +01:00
Andreas Dangel 40bec489ed [java] Fix NPE if generic array type couldn't be resolved
Also add correct imports for GuardLogStatement tests
2021-01-21 16:42:31 +01:00
Andreas Dangel 221c9e785e Merge pull request #3005 from rmohan20:removeOnEventEncoding
[vf] [New Rule] Handle XSS violations that can occur within Html Style
tags #3005
2021-01-21 15:07:05 +01:00
Andreas Dangel 2e3d94adb8 [doc] Update release notes, refs #3005 2021-01-21 15:05:37 +01:00
Andreas Dangel dc4cdf696e Fixups for #3005
- ElEscapeDetector is utility class now
- Improved description and example of new rule
2021-01-21 15:01:58 +01:00
Andreas Dangel b629e26041 Merge pull request #2968 from foxmason:master
[java] NPE in UseCollectionIsEmptyRule with enums #2968
2021-01-21 11:49:38 +01:00
Andreas Dangel 248d4d78e7 [doc] Update release notes, refs #2968, refs #2833 2021-01-21 11:48:51 +01:00
Andreas Dangel 175d535e9f Merge branch 'master' into pr-2968 2021-01-21 11:47:14 +01:00
Andreas Dangel a9a9094ba6 Merge pull request #2963 from tiobe:cpp_ignore_literal_lists
[cpp] Add option to ignore sequences of literals #2963#
2021-01-21 11:44:16 +01:00
Andreas Dangel c42f0496ca [doc] Update release notes, refs #2963 2021-01-21 11:43:08 +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
Maikel Steneker 76566b75bb Minor changes resulting from review 2021-01-21 11:06:29 +01:00
Andreas Dangel 4be2562f01 Fixups for #2968
- Use better typeres
- Add test cases for records and local var
2021-01-21 11:03:51 +01:00
Manuel Moya 944058ff29 Improved sarif with runtime and configuration errors
Added those in toolConfigurationNotifications and toolExecutionNotifications components of invocations (part of sarif standard)
2021-01-20 17:14:08 +01:00
Manuel Moya 3e9fd7b80a Cleaning code 2021-01-20 09:16:00 +01:00
Jeff Bartolotta 15dd8783c7 Convert Pattern to a static final member 2021-01-19 10:28:08 -08:00
Jeff BartolottaandClément Fournier 98acf1de63 Update pmd-visualforce/src/test/java/net/sourceforge/pmd/lang/vf/rule/security/VfHtmlXssStyleTagUrlPatternMatchingTest.java
Co-authored-by: Clément Fournier <clement.fournier76@gmail.com>
2021-01-19 10:11:52 -08:00
Manuel Moya 69bd89884f Fix checkstyle 2021-01-19 18:36:58 +01:00
Manuel Moya f16269a750 Including a SarifLogBuilder and error display 2021-01-19 18:30:39 +01:00
Manuel Moya 68eb4294d4 Initialising vars in start method 2021-01-19 13:29:33 +01:00
Manuel Moya 2aae644dd5 Update pmd_report_formats.md 2021-01-19 12:19:15 +01:00
Manuel Moya a5ac240fd0 Adding doc 2021-01-19 11:59:14 +01:00
Manuel Moya fbb73373ea Sarif format refinement 2021-01-19 11:11:42 +01:00
Manuel Moya 2e2b763b5a Update SarifRenderer.java
Cleaning code
2021-01-19 10:52:16 +01:00
Manuel Moya 52a6ab2e08 Fix checkstyle issues 2021-01-19 10:45:17 +01:00
Manuel Moya e008f2ba71 Cleaning code 2021-01-19 10:07:59 +01:00
Manuel Moya 51b1c1b429 cleaning code 2021-01-18 17:45:52 +01:00
Clément Fournier 7f1b6f582f Deprecate performance.xml/AvoidUsingShortType
Fixes #2296
2021-01-18 16:54:59 +01:00
Clément Fournier 9fe90d4ae4 Deprecate performance.xml/SimplifyStartsWith
Fixes #2740
2021-01-18 16:54:12 +01:00
Manuel Moya 615b33b8b1 Basic sarif renderer with unit tests 2021-01-18 16:32:27 +01:00
Clément Fournier 71262acbb5 Merge branch 'pr/2965'
Refs #2965
2021-01-18 15:35:48 +01:00
Clément Fournier 8759ccdce4 Update release notes, refs #2965 2021-01-18 15:32:51 +01:00
Clément Fournier 908e35be7b Merge branch 'master' into pr/2965 2021-01-18 15:31:43 +01:00
Clément Fournier 6eb36fda4c Merge branch 'pr/2666'
Refs #2666
2021-01-18 15:26:06 +01:00
Clément Fournier e42fa188cc Update release notes, refs #2666 2021-01-18 15:22:29 +01:00
Clément Fournier 7e9f17658c Fixups for #2666
Support full swift 5 string grammar

- arbitrary balanced delimiters
- raw strings ignore escapes
- multiline raw strings

Also rename lexer rules, 'dashed' is not adapted
2021-01-18 15:21:55 +01:00
Clément Fournier b18c73d9b9 Merge branch 'master' into pr/2666 2021-01-18 14:28:55 +01:00
Andreas Dangel e114910048 Merge pull request #2959 from recdevs:feat/apex-equals-hashcode
[apex] New Rule: override equals and hashcode rule #2959
2021-01-17 18:43:44 +01:00
Andreas Dangel 7443b5acc2 [doc] Update release notes, refs #2959 2021-01-17 18:32:16 +01:00
Andreas Dangel ddec921e38 [apex] Fixes from PR #2959
- Update description of new rule OverrideBothEqualsAndHashcode
- add to quickstart (commented out)
- use case insensitive comparison
2021-01-17 18:31:33 +01:00
Andreas Dangel 666281ed2b Merge branch 'master' into pr-2959 2021-01-17 18:11:41 +01:00
Clément Fournier b638bbb549 Fix #3006: [java] NPE in SingularFieldRule with concise resource syntax 2021-01-17 17:55:28 +01:00
Andreas Dangel 9b3fc1da8d Merge pull request #3060 from oowekyala:issue2960-threading-issue
[java] Fix threading issue in MethodNamingConventionsRule #3060
2021-01-17 17:46:04 +01:00
Clément Fournier 0c5bd89033 Also deprecate useless visit methods 2021-01-17 17:40:26 +01:00
Clément Fournier 87f8ca8e9d Deprecate xml base rule classes
Refs #2971
2021-01-17 17:36:29 +01:00
Clément Fournier 5dbff1ab8c Fix PMDTaskTest 2021-01-16 23:12:58 +01:00
Clément Fournier 2f94ee603a Checkstyle 2021-01-16 22:10:00 +01:00
Clément Fournier 27d98fa735 Make unused rules ignore some names, fix #2957 2021-01-16 21:56:45 +01:00
Clément Fournier dbecb80c9e Only use ignored annotation, not lombok one, fix #2876 2021-01-16 21:52:13 +01:00
Clément Fournier 8a191167cf Fix xpath functions 2021-01-16 21:45:35 +01:00
Clément Fournier d025641b34 Test for #2454 2021-01-16 21:25:51 +01:00
Clément Fournier d90d1645db Verify that TypeHelper input is a binary name
Change contract in Annotatable interface

The goal is to allow us to drop support for canonical name
loading in PMD 7, for performance.
2021-01-16 21:22:23 +01:00
Clément Fournier b7ff1aa295 Fix CloseResource reassigned stream
Refs #2977 comment
2021-01-16 21:04:05 +01:00
Clément Fournier c1dca31237 Test for #2977 2021-01-16 20:41:02 +01:00
Andreas Dangel 2591234c66 Merge pull request #2981 from adangel:reproducible-jjtree
[all] Call jjtree/javacc with UTF-8 as default encoding #2981
2021-01-16 19:10:32 +01:00
Clément Fournier f84ca189b4 Update test of CloseResource 2021-01-16 16:36:26 +01:00
Clément Fournier f9295c2bcb Fix bug with extra array dims 2021-01-16 16:25:22 +01:00
Clément Fournier 20a2ab7416 Remove useless code
This made tests fail
2021-01-16 16:13:20 +01:00
Clément Fournier 292d526a73 Fix type resolver tests
The primary prefix now has the type of the receiver,
when it contains the name of a method call
2021-01-16 15:57:24 +01:00
Clément Fournier 28ebe30127 Fix AvoidInstantiatingObjectsInLoopsRule 2021-01-16 15:56:54 +01:00
Andreas Dangel 9158c9f439 [ci] Update pmdtester to 1.1.1, disable debug 2021-01-16 10:12:32 +01:00
Clément Fournier cbceca9861 Fix DoNotUseThreads tests 2021-01-16 00:41:41 +01:00
Clément Fournier 4e96ee6bb7 Fix type res of primary prefix for methods
Consider things accessible if we can't resolve this class.
In particular, local variables were inaccessible, which is absurd.
2021-01-15 23:56:37 +01:00
Clément Fournier 7d87e89f72 Tests for #2979 2021-01-15 23:56:55 +01:00
Clément Fournier 3233ca0127 Tests for #2976 2021-01-15 23:56:46 +01:00
Clément Fournier 1fa9d08d7d Test for #3004 2021-01-15 23:56:37 +01:00
rmohan 6a179980be Applying changes from review feedback 2021-01-15 13:40:07 -08:00
Andreas Dangel cad02c775a Merge branch 'master' into reproducible-jjtree 2021-01-15 18:26:21 +01:00
Clément Fournier 8f021502de Update release notes
Refs #3060
2021-01-15 18:25:28 +01:00
Andreas Dangel ec4dcdd262 [doc] Update release notes, refs #2970 2021-01-15 18:24:45 +01:00
Clément Fournier e8a0ba9815 Make map not static in MethodNamingConventionsRule
Fix #2960
2021-01-15 18:22:33 +01:00
Andreas Dangel 0b5b68169c Merge pull request #3000 from adangel:ci-fixes
[ci] Fixes for pmdtester (baseline, danger) #3000
2021-01-15 14:35:19 +01:00
rmohan 407aa690d1 parent 7fc3dee95a
author rmohan <rmohan@salesforce.com> 1608240897 -0800
committer rmohan <rmohan@salesforce.com> 1610153787 -0800
gpgsig -----BEGIN PGP SIGNATURE-----

 iQIzBAABCAAdFiEEPykD30Ug+JG+ZQ7x5XWwXqT2VuwFAl/4/zsACgkQ5XWwXqT2
 VuwJoBAAsdl/TU3nculnOPwrCHtaxgtM/4zB+wLdw7f+KtIaGMv5A8v8gMbqh0V+
 OTPV0Q/CTEk4PxA2qD5aCPLOaO9+LHOKjPdkWalttVjINtTVPR2pKo0PKR+f2q77
 79eFkhiB1uNx741ThGIZoWPv8eMKHYP+1BEwndFdByxSA70+gdYkbmZqKLLOOrTE
 2uxuGwnNM02ZYskupvgPW2pZvWFviR2sZt/GbFPkqAwgjf40MxM5+3cujOOV850E
 hLHCcch5G5sh8sHTb9nCyNmc6i1kSw9+OOpOHmJGV4u3DRBBtTE9FdwyEUJ2VliZ
 77VrfRPxwzkAE3jTH7EGCY7kpf84jQMqrGn/gav1LfH4DscPZmF617r9iYZ5fOr6
 Z2Fun4vaCXk0h1CojCOpnh4WAthhiVtvBJmdiyO489/hmbtwWuz7KBkCsEVBS+8E
 ViEaQylIOWjcFXkAq5PQ8fCxIqqMgbI7p5kQL6zatpykteMT5zoJj41t8oyjr5Rz
 RUGXNPxpW3zKq3jw4VsjZ8qNYuoSerTzx0qGuUQIALO97HZ8ZBsxmcDTFJrzAkj7
 yfslzLRIoPlL4ZKdpOgCGzVLBX1D/YCBn9KXQiYEYRh57umIt0wpM/Y/Xkl+/Jr4
 97DYj7GQr1gYavSqe7z5n3aUixyibpWy/wx2K3VN6PmtZ3FEB5I=
 =dqIs
 -----END PGP SIGNATURE-----

Creating new VfHtmlStyleTagXss rule to handle XSS in style tags.
Also, refactoring common code out of VfUnescapeElRule to avoid duplication.
2021-01-08 17:08:46 -08:00
Clément Fournier aed09d7b9d Merge branch 'master' into pr/2965 2021-01-08 21:42:41 +01:00
Clément Fournier ab28879460 Merge remote-tracking branch 'upstream/master' 2021-01-08 21:41:29 +01:00
Clément Fournier 0e2eb52d82 Merge branch 'pr/2964'
Refs #2964
2021-01-08 21:39:45 +01:00
Clément Fournier 93e567b8ea Update release notes, refs #2964 2021-01-08 21:39:33 +01:00
Clément Fournier 5efc0c02a3 Merge branch 'master' into pr/2964 2021-01-08 21:31:39 +01:00
Andreas Dangel 83bc024fd3 [ci] Enable debug mode for pmdtester 2021-01-08 16:10:04 +01:00
Andreas Dangel ddcc205516 [ci] Fail if danger couldn't execute pmdtester or upload result 2021-01-08 16:10:04 +01:00
Andreas Dangel 1ae70c2fa0 [ci] Fix config for bundler for executing pmdtester 2021-01-08 16:10:04 +01:00
Andreas Dangel fde4d08213 [ci] Fail if baseline couldn't be created/uploaded 2021-01-08 16:09:56 +01:00
Andreas Dangel 49ff9a5c5f [ci] Increase build timeout for pull requests to 60 minutes 2021-01-08 15:33:48 +01:00
Andreas Dangel 04c0f968dc Merge pull request #2994 from vmaurin:fix-codeclimate-severity
[core] Fix code climate severity strings #2994
2021-01-07 20:19:45 +01:00
Andreas Dangel a5a51f0d5e [doc] Update release notes, refs #2994 2021-01-07 20:16:40 +01:00
Andreas Dangel c7cd242ab2 [core] Renderers - adjust tests for different rule priorities (#2994) 2021-01-07 20:14:29 +01:00
Andreas Dangel 60ee3a4c99 Merge pull request #2983 from
ozangulle:ticket-575/PositionLiteralsFirstInComparisons-should-consider-constant-fields

[java] LiteralsFirstInComparisons should consider constant fields #2983
2021-01-07 19:57:33 +01:00
Andreas Dangel f8e49125ad [doc] Update release notes, refs #2983, fixes #575 2021-01-07 19:54:51 +01:00
Andreas Dangel 740d832dc1 Change from PR review #2983 2021-01-07 19:51:23 +01:00
Andreas Dangel 4b99f42657 [doc] Fix link to deprecated RulesetsFactoryUtils 2021-01-07 15:31:45 +01:00
Andreas Dangel 5ed003c686 Update gems
CVE-2020-26247
https://github.com/advisories/GHSA-vr8q-g5c7-m54m
2021-01-07 15:28:06 +01:00
Andreas Dangel 59493d1e82 [doc] Prefer github discussions for questions 2021-01-07 12:09:10 +01:00
Vincent Maurin c5fa4cbfa0 Fix severity strings
Code Climate issue severity are specified here
https://github.com/codeclimate/platform/blob/master/spec/analyzers/SPEC.md#issues
as `info`, `minor`, `major`, `critical`, or `blocker`. It was mapped to
a value `normal` that is not recognized by tools compatible with Code
Climate's format. I have mapped the five PMD priority values on the five Code Climate severity levels
2021-01-04 15:51:27 +01:00
jr 49bab051e8 fix: use primitive 2020-12-24 14:22:15 -08:00
jr 539f457d81 fix: use rulechain 2020-12-24 14:21:44 -08: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
Ozan Gulle 49fbb90cb1 Changed naming of the method 2020-12-21 21:37:22 +01:00
Ozan Gulle 2bbf56ec06 Added a new test case 2020-12-21 21:37:09 +01:00
Maikel Steneker ed8fbccb1c Add tests for additional C# 7 and C# 8 features 2020-12-18 14:47:59 +01:00
Andreas Dangel c37f208d3e Call jjtree/javacc with UTF-8 as default encoding
Fixes #2970
2020-12-17 18:31:13 +01:00
Andreas Dangel 62a052e97b (dogfood) Further CompareObjectsWithEquals fixes 2020-12-17 16:44:32 +01:00
rmohan 7fc3dee95a Merging Style tag and HTML XSS checks with typecheck changes for real 2020-12-16 16:22:40 -08:00
rmohan 94a3eb636a Changes to fix apex namespace bug 2020-12-16 14:28:35 -08:00
Ozan Gulle 129790ddfc Fixed the order of imports 2020-12-16 22:44:33 +01:00
rmohan 35ee2a534e Redoing HTML Style tag changes on updated Typecheck logic 2020-12-16 13:37:14 -08:00
Ozan Gulle ae12a6db35 Put duplicated code in a separate method 2020-12-16 22:09:11 +01:00
Ozan Gulle d0fb81de1f LiteralsFirstInComparisonsRule also checks for constants 2020-12-16 21:49:38 +01:00
Roopa Mohan ec1718c12f Merge pull request #9 from isv-swat/getLatestFromGithub/12/16/2020
Get latest from GitHub/12/16/2020
2020-12-16 09:40:17 -08:00
jr 275e66d77a [apex] New Rule: override equals and hashcode rule 2020-12-14 14:38:45 -08:00
Andreas Dangel 3a82cf5ae1 (dogfood) Bump pmd from 6.29.0 to 6.30.0 2020-12-12 12:56:42 +01:00
Andreas Dangel 0488c853e3 [ci] Fix creating regression tester baseline for release builds (#2967) 2020-12-12 12:06:59 +01:00
Andreas Dangel a672c5e85d [doc] Fix release notes 2020-12-12 11:46:39 +01:00
Andreas Dangel ba0e9ec7d1 [ci] Install needed gems before rendering release notes (#2967) 2020-12-12 11:29:36 +01:00
Andreas Dangel f276eec0ba [ci] Use ruby 2.7 for release build (#2967) 2020-12-12 11:19:51 +01:00
Andreas Dangel 139a3f6103 [ci] Fix build in trunk (#2967)
The same problem would have occurred for the release build.
2020-12-12 11:19:23 +01:00
Andreas Dangel 06dae58f78 Prepare next development version 2020-12-12 09:51:21 +01:00
Andreas Dangel d284ea9634 [maven-release-plugin] prepare for next development iteration 2020-12-12 09:42:10 +01:00
Andreas Dangel d2e4fb4ca3 [maven-release-plugin] prepare release pmd_releases/6.30.0 2020-12-12 09:42:02 +01:00
Andreas Dangel 39f3026cf1 Prepare pmd release 6.30.0 2020-12-12 09:31:08 +01:00
Mason Fox cce0a35cb1 [java] NPE in UseCollectionIsEmptyRule with enums #2833 2020-12-11 19:43:02 -05:00
Andreas Dangel 1a4ca95f6c Merge pull request #2635 from oowekyala:ruleset-factory-builder
[core] New RuleSet API and deprecations for PMD's entry point APIs #2635
2020-12-11 19:03:41 +01:00
Andreas Dangel afcb45ea89 Remove unneeded suppresswarnings in AbstractPMDProcessor 2020-12-11 18:47:19 +01:00
Andreas Dangel bcbf588bba Rename RuleSetLoadException 2020-12-11 18:35:41 +01:00
Andreas Dangel 4229343173 Use Github Discussions for Q&A 2020-12-11 16:52:17 +01:00
Andreas Dangel feccab274e Bump org.codehaus.groovy:groovy from 2.4.7 to 2.4.21 2020-12-11 16:50:49 +01:00
Andreas Dangel 85ed4f3303 [ci] Fix build badge 2020-12-11 16:12:00 +01:00
Clément Fournier b65f6b85b8 Merge branch 'pr/2962'
Refs #2962
2020-12-11 11:35:25 +01:00
Clément Fournier da3943bf17 Update release notes, refs #2962 2020-12-11 11:34:50 +01:00
Clément Fournier 43d7b32eb3 Merge branch 'master' into pr/2962 2020-12-11 11:33:14 +01:00
Clément Fournier f775d7905b Merge branch 'pr/2864'
Refs #2864
2020-12-11 09:57:10 +01:00
Jeff Bartolotta 4e00c20499 Small comment and doc edits 2020-12-10 22:20:10 -08:00
Clément Fournier aaa540af7b Update release notes 2020-12-10 20:27:13 +01:00
Clément Fournier f7829531c9 Add some doc 2020-12-10 20:17:51 +01:00
Clément Fournier e7f7f7184e Merge branch 'master' into pr/2864 2020-12-10 19:56:08 +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
Maikel Steneker 55598d844a Filter out 2D arrays as well 2020-12-10 12:14:12 +01:00
Maikel Steneker 26728348f6 Add support for C++14 binary literals 2020-12-10 12:10:47 +01:00
Maikel Steneker 3d7fe9fb24 C++ can now ignore sequences of literals
This enables the --ignore-literal-sequences option for the C++ language. This was previously only implemented for C#.
2020-12-10 12:10:47 +01:00
Maikel Steneker af31b3a773 Add GenericToken.getKind() to interface 2020-12-10 12:10:47 +01:00
Jeff Bartolotta f805b85850 Fix Html DataType
This DataType does not need to be escaped, it is always escaped by the
server.
2020-12-09 20:11:25 -08:00
Andreas Dangel 5fffaa90f5 [ci] Update pmdtester to 1.1.0 2020-12-05 15:09:11 +01:00
Andreas Dangel 7f299c4f6c [java] CompareObjectsWithEquals: only allow this with equals (#2934) 2020-12-04 18:21:11 +01:00
Andreas Dangel fcbccbce43 [ci] Fix do-release.sh script 2020-12-04 17:57:56 +01:00
Clément Fournier 70e8639c2b Merge branch 'pr/2945'
Refs #2945
2020-11-30 18:07:01 +01:00
Clément Fournier 968ff53b7c Add links 2020-11-30 18:05:30 +01:00
Clément Fournier 5780739c45 Update CPD md page for #2929 2020-11-30 18:03:06 +01:00
Clément Fournier e999010fb7 Update release notes, refs #2945 2020-11-30 18:00:42 +01:00
Clément Fournier f2faf0996c Add doc in cpd.md 2020-11-30 18:00:37 +01:00
Clément Fournier dc597827b8 Merge branch 'master' into pr/2945 2020-11-30 17:48:15 +01:00
Clément Fournier 2317771d55 Merge branch 'pr/2934'
Refs #2934
2020-11-28 14:40:30 +01:00
Clément Fournier 4f36ac3bd2 Merge branch 'master' into pr/2934 2020-11-28 14:40:09 +01:00
Clément Fournier 317fb54275 Merge branch 'pr/2940'
Refs #2940
2020-11-28 14:26:55 +01:00
Clément Fournier 8d8d4544a7 Update release notes
Refs #2940
2020-11-28 14:26:43 +01:00
Clément Fournier 7eb530f035 Merge branch 'master' into pr/2940 2020-11-28 14:25:28 +01:00
Andreas Dangel db3c636081 [ci] Avoid mixing caches 2020-11-25 14:14:49 +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
Clément Fournier 0244ebf6e3 Fix javadoc 2020-11-25 11:51:54 +01:00
Andreas Dangel f787e3a8e5 [ci] Fetch more commits from master for regression testing PRs
That only needed for pmd/7.0.x PRs
2020-11-25 11:37:30 +01:00
Andreas Dangel ff030d1d2d [ci] Update regression tester
* Remove workaround for pre-downloading baseline
  and add baseline-download-url option
* Remove unnecessary travis_wait
* Add error-recovery flag
2020-11-25 11:26:16 +01:00
Andreas Dangel ee2005a88c [ci] Upload/download baseline for regression tester from pmd-code.org
Baseline is downloaded before executing regression tester, so
that regression tester just reuses it and doesn't try to
download from sourceforge.

We'll only upload to pmd-code.org.
Sourceforge is commented out for now.
2020-11-24 16:15:06 +01:00
Clément Fournier 141c51b0ab Fix ant tests
Report was being rendered mutliple times
2020-11-24 14:43:27 +01:00
Clément Fournier 1a2a897b3f Fix bug with sub-report not being merged into global report 2020-11-24 13:55:26 +01:00
Clément Fournier b0df6a8248 Update pmd-doc module to use newer apis 2020-11-24 13:18:30 +01:00
Clément Fournier 87e2a9c99b Replace checked exception with wrapper 2020-11-24 13:07:43 +01:00
Clément Fournier 37c2c505f3 Merge branch 'master' into ruleset-factory-builder 2020-11-24 12:49:18 +01:00
Clément Fournier 2d5781482e Fix tests 2020-11-24 12:22:32 +01:00
Clément Fournier 4efe1493a5 Remove some unchecked warnings 2020-11-24 12:12:32 +01:00
Clément Fournier b94ac4f018 Don't create a vf language module per parser options 2020-11-24 12:09:25 +01:00
Clément Fournier 898c301ce0 Merge branch 'master' into pr/2864 2020-11-24 12:06:07 +01:00
Clément Fournier 0ad1f47b29 Use interface instead of deprecated abstract class 2020-11-24 12:02:32 +01:00
Clément Fournier 58cf6cbc96 Remove AbstractPropertySource equals/hashCode 2020-11-24 11:55:09 +01:00
Clément Fournier fabf2cf6db Make the parser options properties private 2020-11-24 11:53:45 +01:00
Clément Fournier 21506cea85 Cleanup languages to skip 2020-11-24 11:39:59 +01:00
Andreas Dangel b509e9b9a4 Merge pull request #2920 from oowekyala/pmd:issue-2911-class-leak
[java] Fix memory-leak in type resolution #2920
2020-11-23 15:31:46 +01:00
Clément Fournier 9aaae814c4 Handle TNPE and LinkageE when loading type params 2020-11-23 14:40:32 +01:00
Clément Fournier a5bcdb328a Merge branch 'master' into issue-2911-class-leak 2020-11-23 14:37:17 +01:00
Andreas Dangel 2366b17145 Merge pull request #2936 from igormoreno/pmd:patch-1
[java] (doc) Fix typo: "an accessor" not "a" #2936
2020-11-23 13:59:00 +01:00
Andreas Dangel 30b8a41bba [doc] Update release notes, refs #2936 2020-11-23 13:58:01 +01:00
Andreas DangelandIgor Moreno 1783b1daa1 Update pmd-java/src/main/resources/category/java/bestpractices.xml
Co-authored-by: Igor Moreno <igormoreno@gmail.com>
2020-11-23 13:55:48 +01:00
Andreas Dangel cefd5a6056 Merge pull request #2874 from adangel/pmd:xmlrenderer-utf16
[core] Fix XMLRenderer with UTF-16 #2874
2020-11-23 11:22:34 +01:00
Andreas Dangel af07f1af92 Merge pull request #2914 from GuntherSchrijvers/pmd:issue-1961-include-rule-name-in-text-renderer
[core] Issue 1961 include rule name in text renderer #2914
2020-11-23 11:18:22 +01:00
Andreas Dangel 7d82cec763 [doc] Update release notes, refs #2914, fixes #1961 2020-11-23 11:16:12 +01:00
Andreas Dangel 8cf426a4c3 [doc] Update text renderer format example 2020-11-23 11:15:58 +01:00
Andreas Dangel efc2773e3b Merge pull request #2929 from andyrobinson/pmd:scala_cpd_special_comments
[scala] Add support for CPD-ON and CPD-OFF special comments #2929
2020-11-23 10:46:18 +01:00
Andreas Dangel f7be9256e0 [doc] Update release notes, refs #2929, fixes #2480 2020-11-23 10:44:50 +01:00
Andreas Dangel 43d291ba73 [scala] ScalaTokenizer: Make inner classes static 2020-11-23 10:25:05 +01:00
Andreas Dangel c7f4a1b0fc Merge pull request #2938 from tiobe/pmd:cpd_using_disable
[cs] CPD: fix issue where ignoring using directives could not be disabled #2938
2020-11-23 09:44:00 +01:00
Andreas Dangel 08f2ce30f0 [doc] Update release notes, refs #2938 2020-11-23 09:43:50 +01:00
Andreas Dangel af117ac9c7 Bump m-pmd-p from 3.13.0 to 3.14.0 2020-11-23 09:10:25 +01:00
Andreas Dangel e701f52d96 [java] Catch additional TypeNotPresentExceptions / LinkageErrors
These exceptions are indications of an incomplete auxclasspath
but should not fail PMD entirely.

Incomplete auxclasspath can still result in invalid violations,
either false positives or false negatives.
2020-11-21 16:38:26 +01:00
Jeff Bartolotta 86b5948f07 Update the way nodes with data are identified
Changed method for how the Visualforce strings are reconstructed from the AST. The previous implementation had incorrect assumptions about the structure of the AST. Added tests to more thoroughly test these situations.

Changed name of IdentifierType to DataType. This information can be stored on either ASTIdentifier or ASTLiteral nodes.

Changes based on PR feedgack:
- Restored ParserOptionsTest in order to avoid binary compatibilty issues.
- Changed ParserOptions to contain a PropertySource instead of extending AbtractPropertySource.
2020-11-20 11:59:23 -08:00
Andreas Dangel 02135513c9 [java] CompareObjectsWithEquals: Fix more false positives 2020-11-20 20:39:45 +01:00
Andreas Dangel cda99a1629 [java] CompareObjectsWithEquals - whitelist java.lang.class and this 2020-11-20 16:41:41 +01:00
Andreas Dangel 74c0c020e1 Use new dokka javadoc path 2020-11-20 16:18:18 +01:00
Andreas Dangel 2c950641d2 [java] Avoid false positives with literals 2020-11-20 15:50:30 +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
Andreas Dangel a1297dfd09 [java] Consider comparison with null literal as valid 2020-11-20 12:20:25 +01:00
Andreas Dangel 3020183a29 [doc] Update release notes, refs #2934 2020-11-20 09:07:35 +01:00
Igor Moreno ff77650801 Fix typo: "an accessor" not "a" 2020-11-19 22:59:17 +01:00
Andreas Dangel 1e6c79c19f [java] CompareObjectsWithEquals / UseEqualsToCompareStrings - Fix FN
Fixes false negatives in case fields are referenced with this.
Type resolution on PrimaryExpression works well enough to
simply check the type.
2020-11-19 21:08:15 +01:00
Andy Robinson 035ec0a537 [scala] fixing support for CPD-ON and CPD-OFF special comments
- minor fix ups as per PR comments
- comments are skipped and no longer tokenised
2020-11-18 13:49:32 +00:00
Clément Fournier fd1112ee9b Merge branch 'pr/2925'
Refs #2925
2020-11-16 22:12:24 +01:00
Andy Robinson cb5ce5d9d1 [scala] adding support for CPD-ON and CPD-OFF special comments 2020-11-16 12:08:47 +00:00
abhishek-kumar09 84e6c0997b Correct Annotation Array Initialiation indents from checkstyle #8083 2020-11-16 00:36:30 +05:30
Andreas Dangel bc4938087a [ci] Only install java7 on Linux, add GITHUB_TOKEN for sonar 2020-11-14 20:29:27 +01:00
Andreas Dangel 4147d09771 [ci] Windows needs maven_dependencies_resolve
* Use the same build script for Windows+MacOS as for PRs
* Also install java7 for PRs (that was missing from the old travis solution)
* Run coveralls and sonar in parallel to win/macos after linux
2020-11-14 19:27:40 +01:00
Andreas Dangel faa0a6109e [ci] Fix builds for Windows / MacOS
Add missing include for logger
2020-11-14 18:29:44 +01:00
Clément Fournier b70462b79a Update release notes, refs #2920 2020-11-14 18:16:20 +01:00
Clément Fournier 51c0df8770 Remove cache entirely 2020-11-14 17:48:14 +01:00
Andreas Dangel 4e63a7938a Merge branch 'gh-actions'
[ci] Migrate to github actions (new ci scripts) #2913
2020-11-14 17:41:18 +01:00
Andreas Dangel 13774182b6 Disable debug logging 2020-11-14 17:41:06 +01:00
Clément Fournier 3ccdb5597a Make overload without varargs 2020-11-14 17:15:42 +01:00
Clément Fournier 30124fef11 Don't cache enclosing class (pretty rare to hit it) 2020-11-14 16:54:11 +01:00
Clément Fournier 4ee7b7ae02 Load fewer class names 2020-11-14 16:44:27 +01:00
Clément Fournier 307eacd20a Fix errors 2020-11-14 15:37:04 +01:00
Clément Fournier 00d76b03ab Restrict caching to classes loaded by the bootstrap loader 2020-11-14 15:02:15 +01:00
Clément Fournier 4fe3874824 Simplify constructor of JavaTypeDefinitionSimple 2020-11-14 14:57:25 +01:00
Andreas Dangel 4f2e8b6c8f Fix docu 2020-11-14 14:18:04 +01:00
Andreas Dangel ac07a0a594 Remove travis config 2020-11-14 12:48:59 +01:00
Andreas Dangel 471ea18b0d Add github actions badge 2020-11-14 12:45:21 +01:00
Andreas Dangel 91835315cc Add vendor/bundle to cache 2020-11-14 12:44:57 +01:00
Andreas Dangel 4246cb77ca Add sonar and coveralls jobs 2020-11-14 12:33:31 +01:00
Andreas Dangel e10198402a Apparently spring-framework doesn't build anymore without maven central 2020-11-14 10:54:29 +01:00
Andreas Dangel e686d07263 Update test instructions 2020-11-14 10:07:34 +01:00
Andreas Dangel c19d1823a2 Don't check rule docs on pull requests
This check fails under Windows
2020-11-13 22:08:28 +01:00
Andreas Dangel 244ef6157d Add missing tool zip 2020-11-13 21:37:45 +01:00
Andreas Dangel 574bccb6bf Adjust integration test for new folder .ci 2020-11-13 21:10:52 +01:00
Andreas Dangel 9659a663e9 Add missing include install-openjdk 2020-11-13 21:03:41 +01:00
Andreas Dangel 5cc5e34b7e Fix maven-dependencies 2020-11-13 20:45:11 +01:00
Andreas Dangel e2514c546c Implement release builds 2020-11-13 20:34:37 +01:00
Andreas Dangel 8c087e9357 Describe workaround for failing downloads 2020-11-13 19:43:55 +01:00
Clément Fournier 87892adefe Fix unnecessary throws clause 2020-11-13 17:23:43 +01:00
Andreas Dangel 825e3426d7 Fetch more commits of the PR for danger 2020-11-13 17:15:53 +01:00
Clément Fournier 93c5ef33cf Merge branch 'master' into ruleset-factory-builder 2020-11-13 17:12:27 +01:00
Andreas Dangel a5c7f3c77a Increase fetch depth so that danger finds the HEAD commit of the PR 2020-11-13 15:56:05 +01:00
Andreas Dangel e8525008b2 Move install-openjdk into main script, add check-environment 2020-11-13 15:35:16 +01:00
Andreas Dangel 412ddb3018 Fix pull requests build - correctly extract data from event 2020-11-13 14:58:57 +01:00
Andreas Dangel 9877ea7f96 Add logging groups 2020-11-13 14:44:39 +01:00
Andreas Dangel 7e35165c01 Externalize tokens for Danger, use correct base branch ref 2020-11-13 14:27:26 +01:00
Andreas Dangel be07f5b8c8 Enable windows build again 2020-11-13 12:01:53 +01:00
Andreas Dangel 6e81754078 There are no secrets in pull requests 2020-11-13 12:01:28 +01:00
Andreas Dangel 9d531cba4d Enable pull-requests workflow 2020-11-13 11:39:30 +01:00
Andreas Dangel 70f2c56888 Resolve maven dependencies before building
This tries to solve build timeouts while downloading dependencies.
Also the job timeout for PRs is 30 minutes - if it takes longer,
something is wrong.
2020-11-13 11:37:05 +01:00
Jeff Bartolotta e1c42a10ec Move visitor to VfParser#parse
LanguageVersionHandler#getTypeResolutionFacade is deprecated. Moved the VfExpressionTypeVisitor creation and execution to VfParser#parse instead.

ParsingOptionsTest located in pmd-test wasn't running previously because it was in the src/main hierarchy. Moved this test into the src/test hierarchy and consolidated the methods from the
similarly named class from pmd-core.
2020-11-12 20:13:19 -08:00
Andreas Dangel 1790684fff Add troubleshooting 2020-11-12 20:12:07 +01:00
Andreas Dangel 15fc3f8fc4 Try again with wagon options 2020-11-12 19:47:38 +01:00
jbartolotta-sfdc 0348b2c0d2 Merge branch 'master' into issue1092-vf-escape-false-positives 2020-11-12 10:39:10 -08:00
Andreas Dangel 1edc659456 Take out windows build
It's always failing to download dependencies
2020-11-12 19:15:29 +01:00
Jeff Bartolotta db7bf0a786 Store type information in AST instead of map
Store the IdentifierType on ASTIdentifier node instead of in a separate map.

Use the existing TypeResolution pattern to configure the visitor instead deriving from an abstract rule.

Changed ParserOptions to extend AbstractPropertySource with the ability to override the defaults via environment variables.
2020-11-12 10:15:04 -08:00
Andreas Dangel df7b75087a Another try with maven.wagon.http.pool=false 2020-11-12 18:57:35 +01:00
Andreas Dangel 11932a140d Try to set wagon options via MAVEN_OPTS 2020-11-12 18:35:04 +01:00
Andreas Dangel 3d0f5b0a6c Try disable http pooling 2020-11-12 17:59:43 +01:00
Andreas Dangel 623213e528 Add unzip and timezone 2020-11-12 16:46:35 +01:00
Andreas Dangel c4197fb852 Remove unsupported --no-progress-meter for curl 2020-11-12 16:14:09 +01:00
Andreas Dangel 6b2b33bdec Add docker for testing 2020-11-12 16:13:02 +01:00
GuntherSchrijversandClément Fournier e4ecc3bfb7 Update pmd-core/src/main/java/net/sourceforge/pmd/renderers/TextRenderer.java
Co-authored-by: Clément Fournier <clement.fournier76@gmail.com>
2020-11-12 14:24:05 +01:00
Gunther Schrijvers fbe2e6bb2e [core] Changed output for a violating rule to put the RuleName in front of the description after receiving feedback on the PR. 2020-11-12 13:13:08 +01:00
Andreas Dangel 295505af5b Integrate danger for pull requests 2020-11-12 13:11:56 +01:00
Gunther Schrijvers c7022c4881 [core] Corrected constant naming from SEPERATOR to SEPARATOR. 2020-11-12 13:05:03 +01:00
Andreas Dangel 55dcd77458 Copy files from old .travis directory 2020-11-12 12:29:19 +01:00
Andreas Dangel 7b3a1beeae Remove potential old stale bundle config 2020-11-12 12:17:27 +01:00
Gunther Schrijvers 7ef6084a79 [core] Refactored generation of Text output to use constants defining the 3 different types of text seperators: small '-'; medium ':\t' and large '\t-\t' to increase readability and to standardise the text output. 2020-11-12 11:57:01 +01:00
Andreas Dangel 7691f8ff24 Add debugging hints 2020-11-12 11:55:05 +01:00
Andreas Dangel 4628664545 Add regression-tester for updating baseline 2020-11-12 11:54:51 +01:00
Gunther Schrijvers 72291e9a59 [core] Removed unnecessary explicit casting of Integer to String 2020-11-12 11:46:05 +01:00
Gunther Schrijvers 3a2c1b8334 [core] Modified output of TextRenderer to include the RuleName in the generated output 2020-11-12 11:44:18 +01:00
Andreas Dangel 865e35439b Implement check-environment 2020-11-12 11:43:16 +01:00
Andreas Dangel cf656cc558 Fix path for maven settings, remove progress-meter while downloading 2020-11-12 11:42:50 +01:00
Gunther Schrijvers 8ac13b769e [core] Modified test cases for TextRenderer to include the RuleName in the generated output 2020-11-12 11:41:10 +01:00
Andreas Dangel 0f14066adc Use github job infos 2020-11-12 10:42:19 +01:00
Andreas Dangel 328d2ad828 Move includes into inc/ and files into files/, add pmd_doc support 2020-11-12 10:17:44 +01:00
Andreas Dangel e0a4fafcf4 Make sure to not log secrets while loading 2020-11-12 09:47:55 +01:00
Andreas Dangel b42a358844 Add workaround for connection timeouts 2020-11-12 09:44:17 +01:00
Andreas Dangel 14548e7b80 Integrate setup secrets into build.sh, add env.gpg, add sourceforge upload 2020-11-11 22:56:02 +01:00
Clément Fournier dfb5c4e2d2 Merge branch 'finish-905' 2020-11-11 22:18:32 +01:00
Andreas Dangel 8970b7fcd8 Fix install-openjdk.sh 2020-11-11 21:15:13 +01:00
Clément Fournier a5c42ddefc Add test case for #2595 2020-11-11 15:33:38 +01:00
Andreas Dangel a089bbc143 Use bash 2020-11-10 22:37:04 +01:00
Andreas Dangel 2e1615d7ab Fix wget download of openjdk 2020-11-10 22:34:14 +01:00
Andreas Dangel 3d4928dfbb Initial version of new ci scripts 2020-11-10 22:26:26 +01:00
Clément Fournier 56a5ee536b Deprecations for #905 2020-11-10 14:02:02 +01:00
Clément Fournier 154f9387b2 Merge branch 'deprecations-for-2807'
[core] Deprecations for ParametricRuleViolation and ParserOptions#suppressMarker #2907
2020-11-08 09:03:26 +01:00
Andreas Dangel db404434b4 [modelica] Internalize ModelicaRuleViolationFactory
This was missing, all other impls are internal api already
2020-11-06 16:40:22 +01:00
Andreas Dangel 75d197b592 [core] Add deprecations for ParametricRuleViolation and ParserOptions#suppressMarker 2020-11-06 16:39:22 +01:00
Andreas Dangel ae7fa3d1fe Bump kotest from 4.3.0 to 4.3.1 2020-11-06 11:15:16 +01:00
Andreas Dangel 741d89c5c2 [doc] Fix release notes 2020-11-06 09:55:48 +01:00
Andreas Dangel 52a71f48aa [javascript] Add deprecations for EcmascriptParser/Handler
Refs #2837
2020-11-06 09:26:44 +01:00
Clément Fournier 6eee3d037f Provide replacement api for getRegisteredRuleSets 2020-11-03 15:05:58 +01:00
Clément Fournier ccaf57e8d6 Update release notes 2020-11-03 14:56:08 +01:00
Clément Fournier e30fcaf31d Rename to loadFromResources 2020-11-03 14:52:45 +01:00
Clément Fournier 8f7801c2e7 Remove try with resources 2020-11-03 14:51:23 +01:00
Clément Fournier 4f175a1c4f Hide RuleSetLoader fields 2020-11-03 14:48:29 +01:00
Clément Fournier 08fca9367e Rename RuleSetParser to RuleSetLoader 2020-11-03 14:44:54 +01:00
Clément Fournier 1ff1e07c4d Return a report instead of side-effecting on it
I think this will be more compatible with pmd 7.
2020-11-03 14:43:38 +01:00
Clément Fournier e8b7ecd207 Merge branch 'deprecations-for-70-pr' 2020-11-03 14:18:03 +01:00
Andreas Dangel 34fae59817 [ci] Update "PMD Release Signing Key"
Now Valid till 2021-12-31

http://pool.sks-keyservers.net:11371/pks/lookup?search=0xD0BF1D737C9A1C22&fingerprint=on&op=index
https://keys.openpgp.org/vks/v1/by-fingerprint/EBB241A545CB17C87FACB2EBD0BF1D737C9A1C22
2020-11-02 20:13:17 +01:00
Clément Fournier 873206e657 Replace usages, update reference files 2020-10-31 15:34:54 +01:00
Clément Fournier 53ef99ea95 Update release notes 2020-10-31 15:21:08 +01:00
Clément Fournier bc9557830a Deprecate ASTPackageDeclaration#getPackageNameImage 2020-10-31 15:18:46 +01:00
Clément Fournier 2b9e3057a7 Deprecate ASTTypeParameter#getParameterName 2020-10-31 15:18:36 +01:00
Jeff Bartolotta ba2e91b3a0 Exclude languages in AbstractRuleSetFactoryTest
Allow subclasses of AbstractRuleSetFactoryTest to filter out languages
that show up in the classpath but should not be tested.

Change VFTestContstants to final instead of abstract.
2020-10-29 17:22:35 -07:00
Andreas Dangel 9bda5b368f [ci] Remove jobs for mac and windows on travis
Builds are executed by github actions and don't need
to run on travis again.
2020-10-29 10:14:48 +01:00
Andreas Dangel 27953b4926 Merge branch 'pr-2871' into master
[ci] Use auxclasspath with regression-tester #2871
2020-10-29 10:07:16 +01:00
Jeff Bartolotta 6f7bebcecd Configure visualforce to require Java 8
pmd-visualforce depends on pmd-apex. pmd-apex relies on Java 8. This change configures pmd-visualforce to also require Java 8.

This is a breaking change that will need to be documented.
2020-10-28 15:10:26 -07:00
Clément Fournier ec89913368 Merge branch 'xpath-doc-nodes' 2020-10-28 22:49:02 +01:00
Clément FournierandAndreas Dangel 3e23e6645e Fix release notes format
Co-authored-by: Andreas Dangel <andreas.dangel@pmd-code.org>
2020-10-28 22:48:03 +01:00
Andreas Dangel 9f701ee460 Merge branch 'pr-2870' into master
[lang-test] Upgrade Kotlin, Dokka and Kotest #2870
2020-10-28 16:53:53 +01:00
Andreas Dangel 01f1e8dede Add back pom.parent.relativePath for pmd-lang-test 2020-10-28 16:53:45 +01:00
Andreas Dangel 718b72d00a [java] Add tests for UnusedAssignments
Refs #2843
2020-10-28 16:38:48 +01:00
Andreas Dangel cac03fdb29 [ci] Switch back to pmd/pmd-regression-tester@master 2020-10-28 16:17:11 +01:00
Andreas Dangel 6726640b90 [ci] Use new project-list.xml for Danger 2020-10-28 11:50:00 +01:00
Andreas Dangel fc39b28a9f [ci] Use ruby 2.7 on travis 2020-10-28 11:50:00 +01:00
Andreas Dangel ff6e5278f3 [ci] Update pmd-tester, use auxclasspath
This will test pmd/pmd-regression-tester#72

checkstyle:
Add exclude patterns for checkstyle: after compilation,
testresources appear now under target/test-classes
and they don't need to be analyzed again.
Also exclude generated-sources.
2020-10-28 11:49:57 +01:00
Andreas Dangel 398305144d [ci] Display used java version in github action 2020-10-28 11:03:20 +01:00
Andreas Dangel edc33e6927 [ci] Update install-openjdk to always use latest jdk
This change will download openjdk from fixed URLs
so that we don't need to update the script everytime
a new jdk version is relased.
2020-10-28 11:00:57 +01:00
Jeff Bartolotta f70b2e44fc Rename ExpressionType, remove google collections
Renamed ExpressionType to IdentifierType since this is more accurate.

Removed usage of google.collect classes that were causing UnsupportedClassVersionError exception in the Travis CI run.
2020-10-27 16:23:14 -07:00
Andreas Dangel 9b81f94338 [ci] Update travis build badge
After move to travis-ci.com
2020-10-27 15:34:38 +01:00
Clément Fournier 36e55bc2c1 Fix broken rule reporting 2020-10-27 09:15:16 +01:00
Clément Fournier cc7bb35e72 Checkstyle 2020-10-27 00:30:31 +01:00
Clément Fournier 050ec4464e Stop parsing comma-separated paths by default 2020-10-26 23:42:37 +01:00
Clément Fournier 38a0934fee PMD warnings 2020-10-26 21:33:33 +01:00
Clément Fournier 9c56fb629a Fix bug 2020-10-26 21:21:29 +01:00
Clément Fournier 8f8af7780e Rename stuff 2020-10-26 21:10:58 +01:00
Clément Fournier 7d66d7cbca Doc 2020-10-26 21:00:39 +01:00
Clément Fournier 125b0200ed Deprecate configuration objects 2020-10-26 20:35:02 +01:00
Clément Fournier 8295dad86c Deprecate some methods of PMD 2020-10-26 20:27:38 +01:00
Clément Fournier efb133c74e Cleanup API around processors 2020-10-26 20:24:02 +01:00
Clément Fournier 8958609629 Deprecate other APIs 2020-10-26 20:00:19 +01:00
Andreas Dangel 299e2e817d [doc][skip ci] Update release notes 2020-10-26 19:32:34 +01:00
Clément Fournier 6642f5d038 Isolate single rule pattern 2020-10-26 19:31:48 +01:00
Clément Fournier ac864aa529 Rename 2020-10-26 19:29:19 +01:00
Clément Fournier 412d39f513 Replace createFactory methods with a builder
Deprecate compatibility filter

Deprecate methods in RulesetsFactUtils
2020-10-26 19:26:47 +01:00
Andreas Dangel 91936b000b [core] Fix XMLRenderer with UTF-16
When using UTF-16 as encoding, the XMLRenderer produced
invalid XML: When inserting the linebreak encoded with the
given encoding "UTF-16", a BOM was created. This inserted additional
characters U+FEFF in the middle of the file, which is not allowed.

A partial workaround for this issue would be, to use "UTF-16BE" as
encoding instead. This doesn't create a BOM. However, the resulting XML
file is then completely without a BOM.
2020-10-26 19:19:57 +01:00
Clément Fournier ddcf3536b4 Update release notes, refs #1939 2020-10-26 18:32:53 +01:00
Clément Fournier 27441ae3dc Document #1938 in migration guide 2020-10-26 18:32:42 +01:00
Clément Fournier 0a4dd810c9 Test remaining cases of #1938 2020-10-26 17:57:42 +01:00
Clément Fournier 7a8ca28c3f Check result of / expression
Refs #1938
2020-10-26 17:54:33 +01:00
Clément Fournier c21784843c Check XPath expression result for correct type
Fixes #1939
2020-10-26 17:47:48 +01:00
Clément Fournier a95c67c31e Upgrade to kotlin 1.4.1 and kotest 4.3.0 2020-10-26 17:08:08 +01:00
Andreas Dangel 40cc666507 (dogfood) Bump pmd from 6.28.0 to 6.29.0 2020-10-24 11:38:15 +02:00
Andreas Dangel 21e13e8f55 Prepare next development version 2020-10-24 10:19:00 +02:00
Andreas Dangel 4837c8dbc8 [maven-release-plugin] prepare for next development iteration 2020-10-24 10:17:24 +02:00
Andreas Dangel 81f12d3e5d [maven-release-plugin] prepare release pmd_releases/6.29.0 2020-10-24 10:17:15 +02:00
Andreas Dangel 561e7a8c61 Prepare pmd release 6.29.0 2020-10-24 10:06:54 +02:00
Andreas Dangel df957ad053 Merge branch 'pr-2863' into master
[apex] Add support for Safe Navigation Operator (v50, Winter 21) #2863
2020-10-24 09:48:51 +02:00
Andreas Dangel cfb21d226a Merge branch 'pr-2866' into master
[java] (doc) Fix example for CouplingBetweenObjects #2866
2020-10-23 09:02:42 +02:00
Andreas Dangel 0aafd30d61 Merge branch 'pr-2865' into master
[java] (doc) Update ExcessiveImports example code for clarity #2865
2020-10-23 09:00:52 +02:00
Gustavo Krieger ccb7fd25aa Programming correction in docs
Docs of CouplingBetweenObjects has a Programming issue. I also made "something" a method.
2020-10-22 19:46:46 -03:00
Gustavo Krieger 151400d95b Update ExcessiveImports example code for clarity
Since the default minimum is 30, I believe it would make more sense if the comment said "28" instead of "18".
2020-10-22 19:38:40 -03:00
Jeff Bartolotta ef9e350fd5 Mark AbstractVfTypedElExpressionRule as abstract 2020-10-22 12:11:44 -07:00
Jeff Bartolotta ddf55c7f81 Provide type information to Visualforce rules
Addresses the general issue raised in https://github.com/pmd/pmd/issues/1092 This commit removes false positives from expressions in apex tags. The specific use case raised in 1092 isn't reproducible and represents a false negative that will be fixed separately.

The existing Visualforce rules don't have any information about the data types referenced in the Visualforce page. This results in false positives when attempting to identify expressions that are vulnerable to XSS attacks. The rules should not warn about XSS attacks when the expression refers to a type such as Integer or Boolean.

The VfExpressionTypeVisitor visits the Visualforce page and extracts the datatypes from Salesforce metadata. Data type information can come from either Apex classes or Object Fields. The Salesforce metadata is generally located in a sibling directory of the Visualforce directory. By default the code looks in directories relative to the Visualforce file to find the metadata. The conventional locations for the metadata are "../classes" and "../objects", the user can override this default with other directories if required.
2020-10-22 11:30:45 -07:00
Andreas Dangel b0f3f37e9d [doc] Update release notes, refs #2839 2020-10-22 20:06:20 +02:00
Andreas Dangel e7738e2b4c [apex] Add support and test for parsing SafeNavigationOperator
Refs #2839
2020-10-22 20:02:51 +02:00
Andreas Dangel 9eeea472ac [apex] Update apex-jorje to 2020-09-10-5a5192 (Winter 21, Version 50)
Fixes #2839
2020-10-22 19:13:35 +02:00
Andreas Dangel 47d3e1b9f9 Merge branch 'pr-2816' into master
[apex] Detect 'Database' method invocations inside loops #2816
2020-10-22 18:08:28 +02:00
Andreas Dangel 888fe3b15e [doc] Update release notes, refs #2816, fixes #1713 2020-10-22 18:07:01 +02:00
Andreas Dangel 0745789bb7 [apex] Remove deprecated rules from quickstart.xml, restore Test 2020-10-22 17:58:06 +02:00
Andreas Dangel 2f4079ed8f Merge branch 'pr-2842' into master
[core] Bump antlr4 from 4.7 to 4.7.2 #2842
2020-10-22 16:07:59 +02:00
Andreas Dangel efa66ec83f [doc] Update release notes, refs #2842 2020-10-22 16:06:50 +02:00
Andreas Dangel 95acf2056e Bump antlr from 4.7 to 4.7.2 2020-10-22 14:35:05 +02:00
Andreas Dangel 7f70cac7ca Merge branch 'pr-2834' into master
[vf] Allow attributes with dot in Visualforce #2834
2020-10-22 09:48:36 +02:00
Andreas Dangel 90e7d09110 [doc] Update release notes, refs #2834, fixes #2765 2020-10-22 09:47:55 +02:00
Andreas Dangel 14d1f7a0d3 Merge branch 'pr-2831' into master
[core] Fix XMLRenderer newlines when running under IBM Java #2831
2020-10-22 09:44:20 +02:00
Andreas Dangel 115237940e Merge branch 'pr-2824' into master
[doc] Include deprecated rule references in documentation (Fixes #2823) #2824
2020-10-22 09:42:42 +02:00
Andreas Dangel 873564e69f Merge branch 'pr-2811' into master
[java] CloseResource - Fix #2764: False-negative when re-assigning variable #2811
2020-10-22 09:40:06 +02:00
Andreas Dangel 76e833376c [doc] Update release notes, refs #2811, fixes #2764 2020-10-22 09:38:49 +02:00
Jeff Bartolotta 98d0f0f38f Changes based on initial PR feedback
- Rename AvoidDatabaseMethodCallsInLoopsRule to OperationWithLimitsInLoop.
- Add AvoidDmlStatementsInLoopsRule, AvoidSoqlInLoopsRule, and AvoidSoslInLoopsRule checks into OperationWithLimitsInLoop.
- Deprecate AvoidDmlStatementsInLoopsRule, AvoidSoqlInLoopsRule, and AvoidSoslInLoopsRule in favor of OperationWithLimitsInLoop.
2020-10-21 11:25:20 -07:00
Adrien Lecharpentier 8354ff2efe Bump antlr4 to 4.7.1
A security fix is included in this version. See https://github.com/antlr/antlr4/issues/2069.
2020-10-20 14:54:37 +02:00
rmohan 7e7182b26d Modifying VF tokenizer test content to keep up with the minor grammar change
Streamlined IDENTIFIED_DOTTED logic. Added a couple more negative tests
2020-10-16 09:31:43 -07:00
Andreas DangelandJuan Martín Sotuyo Dodero 61acc52422 [core] XMLRenderer - remove unecessary initialization
Co-authored-by: Juan Martín Sotuyo Dodero <juansotuyo@gmail.com>
2020-10-16 14:38:45 +02:00
Andreas Dangel 40a8ac6f5c Bump junit-vintage-engine from 5.6.2 to 5.7.0 2020-10-15 11:39:04 +02:00
Andreas Dangel dd75d01a2a Bump junit from 4.13 to 4.13.1 2020-10-15 11:35:03 +02:00
Andreas Dangel d626b9314e [ci] Support [skip ci] with github actions
See https://github.com/marketplace/actions/skip-based-on-commit-message
2020-10-15 11:28:46 +02:00
Andreas Dangel b22bc05b4b [skip ci] [doc] Update release notes, refs #2831 2020-10-15 11:14:28 +02:00
Andreas Dangel d8616cca55 [core] Fix XMLRenderer newlines when running under IBM Java 2020-10-15 10:59:56 +02:00
andi 77b183704f fix #2764: false-negative when re-assigning variable 2020-10-14 17:41:28 +02:00
Clément Fournier e3804da978 Update and rename DoNotTerminateVM.java to DoNotTerminateVMTest.java 2020-10-13 23:04:43 +02:00
Clément Fournier b80c78d638 Merge branch 'pr-2829' into master
Refs #2829
2020-10-13 22:58:45 +02:00
Clément Fournier d17eb44fc6 Update release notes, refs #2829 2020-10-13 22:58:04 +02:00
Gustavo Krieger afc0c3fe78 Small correction in pmd_report_formats.md 2020-10-13 16:51:53 -03:00
Andreas Dangel a08985c762 [ci] Fix Dangerfile 2020-10-10 17:25:03 +02:00
Andreas Dangel 69a3914a77 [doc] Renamed/Moved rules are missing in documentation (Fixes #2823)
Include deprecated rule references conditionally
when loading rulesets via RuleSetFactory
2020-10-10 17:02:13 +02:00
Andreas Dangel 92bab9b595 pmd-doc: Add test case for renamed rules
Uses the pattern documented in rule deprecation policy.
The rule reference should be deprecated to get a deprecation
warning, if it is still used.
2020-10-10 16:29:33 +02:00
Andreas Dangel 76190f7d37 Revert "Fix release notes"
This reverts commit ec2b3d873b.
2020-10-10 16:11:04 +02:00
Andreas Dangel b8da15ce00 [ci] use actions/checkout@v2 and actions/setup-java@v1
instead of specific subversions. This uses then always the latest
versions automatically.
2020-10-10 14:03:32 +02:00
Andreas Dangel bebf04e928 Merge branch 'pr-2814' into master
Bump actions/setup-java from v1.4.2 to v1.4.3 #2814
2020-10-10 14:01:42 +02:00
Andreas Dangel 1130ee45a7 Merge branch 'pr-2813' into master
[core] Use JUnit's TemporaryFolder rule #2813
2020-10-10 14:01:03 +02:00
Andreas Dangel 75589de2dd [doc] Update release notes, refs #2813 2020-10-10 14:00:56 +02:00
Andreas Dangel ec2b3d873b Fix release notes 2020-10-10 13:56:36 +02:00
Andreas Dangel e76b0b6946 Merge branch 'pr-2803' into master
[java] Improve DoNotCallSystemExit (Fixes #2157) #2803
2020-10-10 13:07:05 +02:00
Andreas Dangel 710f97db6c [doc] Update release notes, refs #2803, fixes #2157 2020-10-10 13:06:01 +02:00
Andreas Dangel 1150e61ddd [java] Rename DoNotCallSystemExit -> DoNotTerminateVM 2020-10-10 13:05:58 +02:00
Andreas Dangel 636bcdd0e4 Fix build under Windows
Refs #2821
2020-10-09 11:19:16 +02:00
Andreas Dangel d227cffdab [ci] Java rule change is not detected
* Use "HEAD" instead of "FETCH_HEAD" for patch branch.
  FETCH_HEAD might change, if another fetch is done. HEAD
  always points to the currently checked out commit, that
  has been built.
* Add --patch-config to use the same config as for the baseline
  (see .travis/regression-tester.sh). However, currently this
  is ignored, when "--auto-gen-config" is used.
* Use long argument names for better readability

Fixes #2820
2020-10-09 11:03:25 +02:00
Andreas Dangel 462334ccd2 [core] Rule processing error filenames are missing paths #2821
Added test case
Works on pmd6
2020-10-09 10:09:38 +02:00
Jeff Bartolotta 8fb69b24db Add Apex AvoidDatabaseMethodCallsInLoopsRule
Fixes https://github.com/pmd/pmd/issues/1713, Database statements aren't detected in for loops.

- Added new AvoidDatabaseMethodCallsInLoopsRule that adds a violation if any methods from the System Database class are invoked from within a loop.

- Refactored AvoidDmlStatementsInLoopsRule, AvoidSoqlInLoopsRule, and AvoidSoslInLoopsRule to derive from AbstractAvoidNodeInLoopsRule.
2020-10-05 19:02:21 -07:00
dependabot[bot] d37ccca4ab Bump actions/setup-java from v1.4.2 to v1.4.3
Bumps [actions/setup-java](https://github.com/actions/setup-java) from v1.4.2 to v1.4.3.
- [Release notes](https://github.com/actions/setup-java/releases)
- [Commits](https://github.com/actions/setup-java/compare/v1.4.2...d202f5dbf7256730fb690ec59f6381650114feb2)

Signed-off-by: dependabot[bot] <support@github.com>
2020-10-05 06:16:30 +00:00
Stefan Birkner 22db2fdebc Use JUnit's TemporaryFolder rule
Don't reinvent the wheel. TemporaryFolder already takes care of cleaning
up the created files.
2020-10-03 22:59:16 +02:00
Andreas Dangel d5729e65dc Merge branch 'pr-2805' into master
Bump actions/checkout from v2.3.2 to v2.3.3 #2805
2020-10-03 12:23:04 +02:00
Andreas Dangel 16e8c204f1 Merge branch 'pr-2810' into master
[core] Move method "renderTempFile" to XMLRendererTest #2810
2020-10-03 12:12:05 +02:00
Andreas Dangel 079adfb09d [doc] Update release notes, refs #2810 2020-10-03 12:11:33 +02:00
Andreas Dangel 01b5c68ce9 Merge branch 'pr-2809' into master
[java] Move test config from file to test class #2809
2020-10-03 12:10:20 +02:00
Andreas Dangel f67cc4dddd [doc] Update release notes, refs #2809 2020-10-03 12:10:12 +02:00
Vitaly Polonetsky 095f96a966 Added tests to verify the fix for #2157 2020-10-02 00:09:31 -07:00
Stefan Birkner 3d45ea008a Move method "renderTempFile" to XMLRendererTest
It is only used by the XMLRendererTest.
2020-09-30 23:06:56 +02:00
Stefan Birkner 6b23b13497 Move test config from file to test class
Keep it simple. The config file stored only a single line for years.
2020-09-30 22:48:43 +02:00
Andreas Dangel 6e3bd734b8 dogfood - update PMD to 6.28.0 2020-09-28 20:05:39 +02:00
dependabot[bot] 2a6b04ef4d Bump actions/checkout from v2.3.2 to v2.3.3
Bumps [actions/checkout](https://github.com/actions/checkout) from v2.3.2 to v2.3.3.
- [Release notes](https://github.com/actions/checkout/releases)
- [Changelog](https://github.com/actions/checkout/blob/main/CHANGELOG.md)
- [Commits](https://github.com/actions/checkout/compare/v2.3.2...a81bbbf8298c0fa03ea29cdc473d45769f953675)

Signed-off-by: dependabot[bot] <support@github.com>
2020-09-28 06:18:42 +00:00
Andreas Dangel b6edfd68b0 Prepare next development version 2020-09-26 10:27:58 +02:00
Andreas Dangel aa245c6e1b [maven-release-plugin] prepare for next development iteration 2020-09-26 10:25:16 +02:00
Andreas Dangel 722f3ca997 [maven-release-plugin] prepare release pmd_releases/6.28.0 2020-09-26 10:25:05 +02:00
Andreas Dangel d2d4ce2bdb Prepare pmd release 6.28.0 2020-09-26 10:15:02 +02:00
Vitaly Polonetsky e8b95f1a21 Fixes #2157
System.exit() and its equivalents should be allowed in static main() methods, added check for Runtime.getRuntime().halt()
2020-09-25 09:42:51 -07:00
Clément Fournier d74f22b158 Merge branch 'issue-2755' into master 2020-09-25 14:24:24 +02:00
Clément Fournier d3ca0319b3 Merge branch 'master' into issue-2755 2020-09-25 14:24:08 +02:00
Andreas Dangel f1e9a23b01 [doc] Update release notes - group fixes by category 2020-09-24 12:08:10 +02:00
Andreas Dangel 250501a3d1 Merge branch 'pr-2791' into master
[apex] Analyze inner classes for sharing violations #2791
2020-09-24 11:55:11 +02:00
Andreas Dangel eb0f7e4f99 [doc] Update release notes, refs #2791, fixes #2774 2020-09-24 11:54:35 +02:00
Jeff Bartolotta 5429cebf38 Add issue reproducers as standard rule tests
Added false negative and false positive test cases that were logged with
the original issue.
2020-09-21 20:11:07 -07:00
Andreas Dangel 54a5b03ccd Merge branch 'pr-2792' into master
[java] Fix TypeTestUtil for arrays #2792
2020-09-21 19:58:05 +02:00
Andreas Dangel f046268058 [java] CloseResource: add simple test case for var 2020-09-21 19:47:42 +02:00
Andreas Dangel 87890b852a [java] CloseResource: Fix test code 2020-09-21 19:39:24 +02:00
rmohan 5ea116fa52 First draft of change to allow dotted attributes in Visualforce 2020-09-18 13:45:43 -07:00
Andreas Dangel 59f1fe251e Update ant from 1.10.1 to 1.10.8
Fixes CVE-2020-1945 (Moderate severity)
2020-09-18 15:53:33 +02:00
Clément Fournier 8c97300af8 Fix doc
Parameters were in the wrong order.
2020-09-18 04:04:35 +02:00
Clément Fournier 2093011913 Fix array & annot subtyping 2020-09-18 03:58:05 +02:00
Andreas Dangel 7ed238a384 Merge branch 'pr-2789' into master
Add badge for reproducible build #2789
2020-09-17 19:00:19 +02:00
Andreas Dangel c21146019a [doc] Update release notes, refs #2789 2020-09-17 19:00:11 +02:00
Andreas Dangel 81a72cb43e [java] CloseResource: Fix NPE in case of "var" 2020-09-17 18:49:21 +02:00
Dan Rollo d421927547 Add badge for reproducible build 2020-09-17 12:04:14 -04:00
Jeff Bartolotta c6b7a723be Analyze inner classes for sharing violations
Fixes https://github.com/pmd/pmd/issues/2774, false positives and false
negatives for ApexSharingViolationsRule.

Sharing settings are not inherited by inner classes. Sharing settings
need to be declared on the class that contains the Database method, DML,
SOQL, or SOSL.

The change inverts the direction from which nodes are found and
analyzed. The previous code visited the ASTUserClass and then searched
for descendant nodes that met a certain criteria. It did not visit inner
ASTUserClass nodes because it didn't use rule chains or call the super's
visit moethod for ASTUserClassi.

The new implementation visits all nodes that correspond to Database
method, DML, SOQL, or SOSL nodes and then finds the nearest ASTUserClass
parent node. This ASTUserClass is examined to determine if it has
declared a sharing setting as required.
2020-09-17 08:36:45 -07:00
Andreas Dangel f00e9744ea Merge branch 'pr-2784' into master
[java] Lambda parsing bug #2784
2020-09-17 14:58:32 +02:00
Andreas Dangel d81731ed6c [doc] Update release notes, refs #2784, fixes #2783 2020-09-17 14:57:55 +02:00
Clément Fournier 3c1b0afcf6 Fix #2783 2020-09-16 15:40:45 +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
Andreas Dangel 04592c8038 [core] Deprecate RuleReference#getOverriddenLanguage() and #setLanguage()
Refs #2742
2020-09-13 09:18:34 +02:00
Andreas Dangel dacfff1abf Merge branch 'pr-2758' into master
[cpd] Improve AnyTokenizer #2758
2020-09-12 19:25:47 +02:00
Andreas Dangel d261f44696 [doc] Update release notes, refs #2758, fixes #2760 2020-09-12 19:24:34 +02:00
Andreas Dangel 3f69e9188b [core] AnyTokenizer: add TODO for PMD7 2020-09-12 19:14:00 +02:00
Andreas Dangel 5192fdc0f9 [core] AnyTokenizer: Add testcase to verify #2760 is fixed 2020-09-12 19:13:43 +02:00
Andreas Dangel 53f3759ede Merge branch 'pr-2776' into master
Bump actions/setup-java from v1.4.0 to v1.4.2 #2776
2020-09-12 18:42:24 +02:00
dependabot[bot] 72f9d0f90a Bump actions/setup-java from v1.4.0 to v1.4.2
Bumps [actions/setup-java](https://github.com/actions/setup-java) from v1.4.0 to v1.4.2.
- [Release notes](https://github.com/actions/setup-java/releases)
- [Commits](https://github.com/actions/setup-java/compare/v1.4.0...8bb50d97d6b4d316daf284fdf8eafbfc988421fc)

Signed-off-by: dependabot[bot] <support@github.com>
2020-09-12 10:46:46 +00:00
Andreas Dangel 352760c09c [ci] Fix dependabot schedule interval 2020-09-12 12:45:52 +02:00
Andreas Dangel 516fa5e01a Merge branch 'pr-2735' into master
[ci] Add github actions for a fast view of pr succeed/not #2735
2020-09-12 12:14:37 +02:00
Andreas Dangel c3b5e1a5c1 [doc] Update release notes, refs #2735 2020-09-12 12:13:44 +02:00
Andreas Dangel b247d616d9 [ci] github actions: Build on push and pull requests 2020-09-12 12:13:28 +02:00
Andreas Dangel 2093f6c82a [ci] dependabot: don't open PRs for maven dependencies
We might enable this for PMD 7 later
2020-09-12 12:13:04 +02:00
Andreas Dangel 66a97f6686 Merge branch 'pr-2741' into master
[core] Deprecate ruleviolation comparator #2741
2020-09-12 11:51:19 +02:00
Andreas Dangel d039605747 [doc] Mention replacement for deprecated RuleViolationComparator 2020-09-12 11:51:11 +02:00
Andreas Dangel 606d25de82 Merge branch 'pr-2761' into master
[java] Fix #2759, UnusedAssignment false positive #2761
2020-09-12 11:37:09 +02:00
Andreas Dangel 20d48caa65 [doc] Update release notes, fixes #2759 2020-09-12 11:36:20 +02:00
Andreas Dangel 9ed79f46fd Merge branch 'pr-2770' into master
[java] Fix #2767, PMD cannot parse a local var with final in instance initializer #2770
2020-09-11 17:52:25 +02:00
Andreas Dangel a13f88de5f [doc] Update release notes, fixes #2767 2020-09-11 17:51:36 +02:00
Andreas Dangel 6af4f1ecea Merge branch 'pr-2771' into master
[java] Fix #2756, NPE in TypeTestUtil #2771
2020-09-11 17:40:43 +02:00
Andreas Dangel 4f53b77045 [doc] Update release notes, fixes #2756 2020-09-11 17:40:04 +02:00
Andreas Dangel d752b2c424 Merge branch 'pr-2773' into master
[java] issue-2738: Adding null check to avoid npe when switch case is default #2773
2020-09-11 17:15:03 +02:00
Andreas Dangel 7cea1d684c [doc] Update release notes, fixes #2738, refs #2773 2020-09-11 17:02:40 +02:00
Andreas Dangel 2d0d098d2c [java] Add test case for #2738 2020-09-11 16:59:16 +02:00
Nimit fedea535b5 issue-2738: Adding null check to avoid npe when switch case is default 2020-09-10 19:19:43 -07:00
Clément Fournier 46933e666d Fix #2756, NPE in TypeTestUtil 2020-09-10 12:49:45 +02:00
Clément Fournier fc759db5ca Fix #2767
Problem was the stack is empty if the local var declaration
is the first node of the compilation unit to be pushed.
2020-09-10 12:24:03 +02:00
Clément Fournier d6ba977bb8 Merge branch 'ollieabbey-master' into master
Refs #2747
2020-09-06 18:32:56 +02:00
Clément Fournier bcb04df160 Merge branch 'master' into ollieabbey-master 2020-09-05 18:38:44 +02:00
Clément Fournier dddbaf0a6a Merge branch 'master' into deprecate-rv-comparator 2020-09-03 12:17:05 +02:00
Clément Fournier b0f924495b Fix bug
Problem was, isInTryBlock didn't ask for parent
states, even though abruptCompletionByThrow does.
2020-09-03 12:13:37 +02:00
Clément Fournier a43dea916d Fix JS tests
Rewrite assertions for better error messages
The difference is 32 tokens instead of 30;
this is because previously, AnyTokenizer
tokenized `window.alert` as a single token. Now
it tokenizes it a `window`, `.`, `alert`.
2020-09-03 11:40:03 +02:00
Clément Fournier 3a33092d22 Add test case 2020-09-02 16:45:19 +02:00
Clément Fournier 24f3017109 Update release notes 2020-09-01 18:23:47 +02:00
Clément Fournier 10b205b5e2 REVERT ME Make end column inclusive
This is for consistency with PMD 6, on pmd 7 this commit
may be reverted
2020-09-01 18:11:08 +02:00
Clément Fournier dd440eb14a Fix tests 2020-09-01 18:11:05 +02:00
Clément Fournier 251a217a59 Checkout StringUtils parts from 7.0.x branch 2020-09-01 17:53:33 +02:00
Clément Fournier 21aeabdf45 Deprecate AbstractTokenizer 2020-09-01 17:50:39 +02:00
Clément Fournier 9af59c503b Fix linenos with multiline strings 2020-09-01 17:50:31 +02:00
Clément Fournier 5f4d489ec8 Fix tests 2020-09-01 17:50:31 +02:00
Clément Fournier 5331be392b Add perl tests 2020-09-01 17:50:31 +02:00
Clément Fournier bc4b008b6e Same for Fortran 2020-09-01 17:50:29 +02:00
Clément Fournier bc0d9c781d Use it to replace RubyTokenizer 2020-09-01 17:50:21 +02:00
Clément Fournier b27ab97684 Improve AnyTokenizer 2020-09-01 17:50:06 +02:00
Andreas Dangel 3ce68f4977 dogfood - update PMD to 6.27.0 2020-09-01 14:18:07 +02:00
Ollie Abbey b3e0c54a80 Fixed a typo 2020-09-01 09:03:28 +01:00
Ollie Abbey 85754378f7 Added test for multiple VariableDecoratorIds 2020-09-01 09:02:48 +01:00
Ollie Abbey 776c0c154f Addressed review comments 2020-09-01 08:55:52 +01:00
Ollie Abbey ba5c2f4288 Merge pull request #1 from pmd/master
Update with changes
2020-09-01 08:52:34 +01:00
Andreas Dangel 6d69bdb386 Prepare next development version 2020-08-31 18:32:02 +02:00
Andreas Dangel c59af0aee6 [maven-release-plugin] prepare for next development iteration 2020-08-31 18:30:18 +02:00
Andreas Dangel 856950f0d2 [maven-release-plugin] prepare release pmd_releases/6.27.0 2020-08-31 18:30:09 +02:00
Andreas Dangel e198a61515 Prepare pmd release 6.27.0 2020-08-31 18:18:44 +02:00
Andreas Dangel b55a227369 Merge branch 'pr-2745' into master
[core] Fix a NPE in buildUsageText #2745
2020-08-31 17:55:11 +02:00
Andreas Dangel d82c9f1413 [doc] Update release notes, refs #2745 2020-08-31 17:53:55 +02:00
Clément Fournier 4559e35b66 Merge branch 'cpd_dart_escaped_dollar' into master
Refs #2750
2020-08-30 16:54:16 +02:00
Clément Fournier af9770af1f Update release notes 2020-08-30 16:54:09 +02:00
Clément Fournier 13146b5c53 Merge branch 'master' into cpd_dart_escaped_dollar 2020-08-30 16:52:55 +02:00
Clément Fournier 81c82729e3 Merge branch 'cpd_dart_string_interpolation' into master
Refs #2749
2020-08-30 16:49:31 +02:00
Clément Fournier 2cff5dd4b7 Update release notes 2020-08-30 16:49:22 +02:00
Clément Fournier e95c90a05a Merge branch 'master' into cpd_dart_string_interpolation 2020-08-30 16:47:38 +02:00
Clément Fournier c2069282a7 Add test case for more complicated interpolations 2020-08-30 16:47:25 +02:00
Clément Fournier ebae5549e1 Merge branch 'fix_typos' into master
Refs #2744
2020-08-28 14:19:41 +02:00
Clément Fournier bf88cba7e5 Update release notes, refs #2744 2020-08-28 14:19:33 +02:00
Clément Fournier 104e71d497 Merge branch 'master' into StringBuilder_issues 2020-08-28 14:04:56 +02:00
Clément Fournier 292fa74ef5 Simplify test
I don't think we need to assert everything, the pmd-dist module
already has a test like that
2020-08-28 14:04:38 +02:00
Clément Fournier 986b39208f Remove dead code in PMDCommandLineInterface 2020-08-28 13:59:43 +02:00
Maikel Steneker 7740e47292 Escaped characters in Dart multiline string are now handled correctly 2020-08-27 14:21:10 +02:00
Maikel Steneker 74a9950128 Improvements for Dart interpolated strings
The Dart tokenizer was incomplete, resulting in some strings that use
string interpolation not being parsed correctly. This has been worked
around by making sure that the contents of string interpolation are all
included in the same string token.
2020-08-27 13:16:56 +02:00
Ollie Abbey 363c3a30ff Trigger for non lombok Builder.Default 2020-08-27 08:45:53 +01:00
XenoAmess d85d1058e1 fix 2020-08-27 13:54:12 +08:00
XenoAmess 32698d8c6b add unit test for the change made. 2020-08-27 13:43:24 +08:00
XenoAmess e5d0b7243f revert in package net.sourceforge.pmd.lang.java.typeresolution 2020-08-27 12:09:19 +08:00
XenoAmess e15223f722 Merge remote-tracking branch 'XenoAmess/fix_typos' into fix_typos
# Conflicts:
#	pmd-java/src/main/java/net/sourceforge/pmd/lang/java/rule/design/CouplingBetweenObjectsRule.java
2020-08-27 12:02:58 +08:00
XenoAmessandClément Fournier 1a443f92f3 Update pmd-java/src/main/java/net/sourceforge/pmd/lang/java/rule/documentation/CommentContentRule.java
Co-authored-by: Clément Fournier <clement.fournier76@gmail.com>
2020-08-27 12:02:21 +08:00
XenoAmess 39be80485a convenient to convenience 2020-08-27 12:01:57 +08:00
XenoAmessandClément Fournier 44a08faf7f Update pmd-java/src/main/java/net/sourceforge/pmd/lang/java/rule/design/CouplingBetweenObjectsRule.java
Co-authored-by: Clément Fournier <clement.fournier76@gmail.com>
2020-08-27 12:01:20 +08:00
XenoAmess bab82f5d98 revert release_notes_old.md 2020-08-27 11:59:56 +08:00
XenoAmess 7e8146f70a descendant-self to descendant-or-self 2020-08-27 11:53:51 +08:00
XenoAmess 627fb430bd improve to improvement 2020-08-27 11:52:17 +08:00
XenoAmess 2e258aa529 revert changes to InnaccurateNumericLiteral 2020-08-27 11:49:39 +08:00
XenoAmess 244a39db0f fix typos. 2020-08-27 11:47:11 +08:00
Ollie Abbey cd98a36b66 [java] Fix 2708: False positive FinalFieldCouldBeStatic 2020-08-26 16:52:13 +01:00
XenoAmess efd87c50e4 Fix a NPE created by the last pr.
Sorry about that.
2020-08-26 21:08:51 +08:00
Clément Fournier 31b75d3acb Update release notes 2020-08-25 16:48:16 +02:00
Clément Fournier fde23333a0 Deprecate ruleviolation comparator 2020-08-25 16:37:19 +02:00
Clément Fournier 8c3277b8a2 Merge branch 'use_addAll' into master
Refs #2733
2020-08-25 14:51:13 +02:00
Clément Fournier 129de133cf Merge branch 'master' into use_addAll 2020-08-25 14:50:23 +02:00
Clément Fournier 5574e561ab Merge branch 'StringBuilder_issues' into master
refs #2730
2020-08-25 14:49:09 +02:00
Clément Fournier d945ee70e1 Merge branch 'master' into StringBuilder_issues 2020-08-25 14:48:23 +02:00
Clément Fournier 4c7c80d254 Merge branch 'suspicious-equals' into master 2020-08-25 14:40:33 +02:00
Clément Fournier 99e86557e8 Update release notes, refs 2724 2020-08-25 14:40:24 +02:00
Clément Fournier 36c3d87272 Add md formatting 2020-08-25 14:38:59 +02:00
Clément Fournier d7df3d342b Merge branch 'master' into suspicious-equals 2020-08-25 14:37:56 +02:00
Clément Fournier 0a18460234 Update pmd-java/src/main/resources/category/java/errorprone.xml 2020-08-25 14:37:29 +02:00
Clément Fournier 8689864ad1 Merge branch 'mateusz-stefanski-master' into master 2020-08-25 14:31:52 +02:00
Clément Fournier 50bb7876b6 Update release notes, refs #2723 2020-08-25 14:31:41 +02:00
Clément Fournier ab7b7a4ad7 Use markdown format 2020-08-25 14:29:01 +02:00
Clément Fournier 4d888eeaab Merge branch 'master' into mateusz-stefanski-master 2020-08-25 14:27:19 +02:00
XenoAmess 90f53f892f StringBuilder issues 2020-08-25 03:06:56 +08:00
Clément Fournier 98e4114745 Update release notes 2020-08-24 20:42:48 +02:00
Clément Fournier 699ee7e2bf Merge branch 'use_try_with_resource' into master
refs #2734
2020-08-24 20:33:00 +02:00
Clément Fournier b6531787d3 Merge branch 'use_StandardCharsets' into master
refs #2732
2020-08-24 20:30:30 +02:00
Clément Fournier e949bf5162 Merge branch 'avoid_compiling_patterns_times_to_times' into master
Refs #2731
2020-08-24 20:29:21 +02:00
Clément Fournier 195104cc4a Merge branch 'printf_to_print' into master
Refs #2729
2020-08-24 20:28:42 +02:00
Clément Fournier dc4e93ffe7 Merge branch 'javadoc' into master
Refs #2728
2020-08-24 20:20:39 +02:00
Clément Fournier 9c5759917d Merge branch 'index_of_to_contains' into master
Refs #2727
2020-08-24 20:20:12 +02:00
Clément Fournier fe34bec0d4 Merge branch 'wrongly_boxing' into master
Refs #2725
2020-08-24 20:16:52 +02:00
Clément Fournier 112dcbd5fb Merge branch 'StringBuffer_to_StringBuilder' into master
Refs #2726
2020-08-24 20:15:40 +02:00
XenoAmess 13af7b530d fix javadoc 2020-08-24 19:33:47 +08:00
XenoAmess 31ee6bfca1 fix checkstyles 2020-08-24 19:29:44 +08:00
XenoAmess 01de9ce450 add github actions for a fast view of pr succeed/not.
travis-ci is toooo slow.
2020-08-24 19:15:52 +08:00
XenoAmess fc19861509 fix checkstyle 2020-08-24 19:08:32 +08:00
XenoAmess 3e0a7df72d use print instead of printf as no format exist. 2020-08-24 16:59:00 +08:00
XenoAmess 33f4e27254 addAll issues 2020-08-24 16:58:10 +08:00
XenoAmess c5e2234763 use try with resource 2020-08-24 16:50:41 +08:00
XenoAmess 135d17b4ae valueOf to parse when we need primitive return value. 2020-08-24 16:48:50 +08:00
XenoAmess 33e4f98274 StringBuffer to StringBuilder 2020-08-24 16:45:11 +08:00
XenoAmess b9e62fb4eb indexOf to contains 2020-08-24 16:43:23 +08:00
XenoAmess 327eaaedf6 use StandardCharsets 2020-08-24 16:30:04 +08:00
XenoAmess d9d4b31a3a avoid compiling patterns times to times 2020-08-24 16:22:33 +08:00
Mateusz Stefanski af6969a29a [doc] [java] SuspiciousEqualsMethodName: update description, fixes #2264 2020-08-23 21:02:25 +02:00
Mateusz Stefanski c161e57c1d [doc] [java] SimplifyStartsWith: update description and example, fixes #1868 2020-08-23 19:20:17 +02:00
Andreas Dangel 3a7ea4b606 Update pmd-designer to 6.27.0 2020-08-23 18:40:55 +02:00
Clément Fournier e6e7e1854e Merge branch 'deprecations-for-2661-and-2706' into master 2020-08-23 16:41:00 +02:00
Clément Fournier f7a78011ac Merge branch 'master' into deprecations-for-2661-and-2706 2020-08-23 16:40:51 +02:00
Andreas Dangel a98f3d6201 Merge branch 'pr-2721' into master
[java] Deprecate old symbol table, add replacement for TypeHelper #2721
2020-08-23 10:01:34 +02:00
Andreas Dangel ac365bc7a0 Merge branch 'pr-2722' into master
[doc] [java] ImmutableField: extend description, fixes #2108 #2722
2020-08-23 09:48:59 +02:00
Andreas Dangel 2248a0c04a [doc] Update release notes, refs #2722, fixes #2108 2020-08-23 09:48:40 +02:00
Mateusz Stefanski 0889b94aa5 [doc] [java] ImmutableField: extend description, fixes #2108 2020-08-23 01:15:18 +02:00
Clément Fournier 400c02affa Merge branch 'jdk15' into master 2020-08-22 19:42:29 +02:00
Clément Fournier 1c4390fed4 Fix tests 2020-08-22 19:42:05 +02:00
Clément Fournier 0b026d1ab4 Merge branch 'master' into jdk15 2020-08-22 19:31:16 +02:00
Clément Fournier 2e1e0ed3a4 Rename PermittedSubclasses to PermitsList 2020-08-22 19:30:38 +02:00
Andreas Dangel 11fca0c480 [java] Deprecate JavaParserVisitorReducedAdapter 2020-08-22 19:03:52 +02:00
Clément Fournier ab971f1c8f Fix tests 2020-08-22 18:48:50 +02:00
Andreas Dangel 0b92a768da [apex] Deprecate ApexParserVisitorReducedAdapter
See also #2661
2020-08-22 18:30:42 +02:00
Clément Fournier bee844d57d Duplicate tests 2020-08-22 18:25:42 +02:00
Andreas Dangel 6a4b1a7a2d [scala] Deprecate ScalaParserVisitorAdapter#zero and #combine
Those will go away with PMD 7.
2020-08-22 18:24:48 +02:00
Andreas Dangel d6853c5d0e [jsp] Deprecate unused nodes ASTJspDeclarations and ASTJspDocument 2020-08-22 18:22:59 +02:00
Clément Fournier 95140fc2cb Update release notes 2020-08-22 18:17:11 +02:00
Clément Fournier 30b76285e3 Add replacement for TypeHelper 2020-08-22 18:17:08 +02:00
Clément Fournier ac94110fc4 Mark symbol table classes as internal api 2020-08-22 18:00:04 +02:00
Andreas Dangel 1982d0d39b Use non-snapshot build-tools version 8 2020-08-21 11:25:55 +02:00
Andreas Dangel 1d95b3c1d3 Merge branch 'pr-2700' into master
[java] Fix OnlyOneReturn code example #2700
2020-08-21 10:59:18 +02:00
Andreas Dangel 7fef132ad4 [doc] Update release notes, refs #2700 2020-08-21 10:58:44 +02:00
Andreas Dangel d1ae206f58 Merge branch 'pr-2695' into master
[java] Improve example for AvoidSynchronizedAtMethodLevel #2695
2020-08-21 10:57:22 +02:00
Andreas Dangel 86cfa9a952 Merge branch 'pr-2685' into master
[java] Fix NoClassDefFoundErrors #2685
2020-08-21 10:42:57 +02:00
Andreas Dangel 7d1567d9c8 Merge branch 'pr-2699' into master
[java] ProperCloneImplementation not valid for final class #2699
2020-08-21 10:41:25 +02:00
Andreas Dangel 18abedc164 [doc] Update release notes, fixes #2410, refs #2699 2020-08-21 10:40:37 +02:00
Andreas Dangel 0dbda8e0be Merge branch 'pr-2671' into master
[java] CloseResource false positive when resource included in return value #2671
2020-08-21 10:22:15 +02:00
Andreas Dangel 3e25bb8680 Merge branch 'pr-2697' into master
[java] ExcessiveParameterListRule must ignore a private constructor #2697
2020-08-21 09:55:00 +02:00
Andreas Dangel 1a5aab6f50 [doc] Update release notes, refs #2697, fixes #2461 2020-08-21 09:50:35 +02:00
Andreas Dangel b73b1e92f3 [java] CloseResource: add new property "closeNotInFinally" 2020-08-21 09:33:24 +02:00
Andreas Dangel 36f61f44aa [java] CloseResource: fix false positive with close on not closeable 2020-08-21 09:15:30 +02:00
Andreas Dangel 0e743cc542 Merge branch 'master' into pr-2671 2020-08-20 19:13:14 +02:00
Andreas Dangel 61ba8efcc1 [doc] Update release notes, fixes #2470, refs #2671 2020-08-20 19:10:01 +02:00
Andreas Dangel 9e1370fac7 [java] CloseResource - avoid duplicated violations 2020-08-20 19:07:52 +02:00
Andreas Dangel 31b82c9977 Merge branch 'pr-2674' into master
[java] add lombok.EqualsAndHashCode in AbstractLombokAwareRule #2674
2020-08-20 17:02:45 +02:00
Andreas Dangel 9b4dc98b44 [doc] Update release notes, fixes #2673, refs #2674 2020-08-20 17:01:45 +02:00
Andreas Dangel ae756184a6 [java] Fix tests + rules UnusedPrivateField and SingularField 2020-08-20 16:59:04 +02:00
Andreas Dangel e527159d04 [doc] Update release notes, mention #2656 also under fixed issues 2020-08-20 11:13:42 +02:00
Andreas Dangel 850ea5cf9a Merge branch 'pr-2656' into master
[all] Ensure PMD/CPD uses tab width of 1 for tabs consistently #2656
2020-08-20 11:09:58 +02:00
Andreas Dangel d1c49baae1 Fix checkstyle
(note, this needs an updated build-tools)
2020-08-20 11:02:55 +02:00
Andreas Dangel 60d7539e31 [doc] Update release notes, refs #2656 2020-08-20 10:42:38 +02:00
Andreas Dangel 06d2225b27 [vf] Deprecate VfSimpleCharStream 2020-08-20 10:38:41 +02:00
Andreas Dangel 23bc58f23c [vf] Use tabSize=1 as well 2020-08-20 10:38:19 +02:00
Andreas Dangel 89140d86ce Merge branch 'master' into pr-2656 2020-08-20 09:47:16 +02:00
Andreas Dangel 04850c69bc [java] Rework tests for Java 15 and Java 15 Preview 2020-08-19 18:54:00 +02:00
Andreas Dangel 67b37de334 [java] Rework BlockStatement to allow local interfaces, enums, ... 2020-08-16 21:42:36 +02:00
Andreas Dangel fceb474df0 [java] Remove "non-sealed" token and use semantic lookahead instead 2020-08-16 18:22:45 +02:00
berkam 186eaa251c add test for lombok.EqualsAndHashCode 2020-08-16 18:51:25 +03:00
berkam 84e64c55bd add EqualsAndHashCode in EqualsAndHashCode 2020-08-16 18:45:56 +03:00
berkam 64aedd6596 add EqualsAndHashCode in UnusedPrivateFieldRule 2020-08-16 18:44:40 +03:00
berkam 88eed10921 delete EqualsAndHashCode from AbstractLombokAwareRule 2020-08-16 18:42:14 +03:00
Andreas Dangel 839941d4eb [java] Don't add linkage errors as processing errors, just log 2020-08-16 15:02:21 +02:00
Andreas Dangel 44b5f9ec17 Merge branch 'pr-2662' into master
[java] UnnecessaryCaseChange can not detect the case like: foo.equals(bar.toLowerCase()) #2662
2020-08-16 11:47:57 +02:00
Andreas Dangel 7a62f0bbe1 [doc] Update release notes, fixes #2531, refs #2662 2020-08-16 11:46:14 +02:00
Andreas Dangel 28aaeefdd9 [doc] Update release notes, fixes #2646 2020-08-14 22:26:54 +02:00
Andreas Dangel 8b159f389a [java] Remove Experimental for TextBlocks, Update javadoc for Java15 Preview 2020-08-14 22:20:40 +02:00
Andreas Dangel 0d9b5a7c3b [java] Support Sealed Classes with Java 15 Preview 2020-08-14 22:16:41 +02:00
Andreas Dangel cda155891a [java] Add ugly lookahead for local record declarations
so that it can be distinguished from local var decl or other
statements.
2020-08-14 20:56:26 +02:00
Andreas Dangel 4d2853ccc4 [java] Add support for local records (Java 15 Preview) 2020-08-14 18:55:00 +02:00
Andreas Dangel 0a29732909 Fix Kotlin Tests 2020-08-13 20:54:34 +02:00
Andreas Dangel e51519c5fd [java] Support Records with Java 15 Preview 2020-08-13 20:42:08 +02:00
Andreas Dangel e596a67297 [java] Support Pattern Matching for instanceof with Java 15 Preview. 2020-08-13 20:11:25 +02:00
Andreas Dangel 40f0eedf88 [java] Text Blocks are now a permanent language feature with JDK 15 2020-08-13 20:05:54 +02:00
Andreas Dangel 2a2fa20883 [java] Update ASM for bytecode parsing 2020-08-13 19:29:45 +02:00
Andreas Dangel 02a78f5bea [java] Add versions 15 (new default) and 15-preview, remove 13-preview 2020-08-13 19:15:02 +02:00
Andreas Dangel 575d1262a9 Merge branch 'pr-2659' into master
[java] StringToString can not detect the case: getStringMethod().toString() #2659
2020-08-13 18:29:13 +02:00
Andreas Dangel dbf3bbe1d5 [doc] Update release notes, refs #2659, fixes #2530 2020-08-13 18:27:50 +02:00
Andreas Dangel 278e4f3414 Fix pmd, add missing test classes for typeres 2020-08-13 17:00:34 +02:00
Andreas Dangel c48f407e28 [java] StringToString: fix impl for method calls as args 2020-08-13 15:52:09 +02:00
Mykhailo Palahuta 7765ee178a [java] StringToString: Add more tests 2020-08-13 15:50:37 +02:00
Andreas Dangel bb8edec8c9 Merge branch 'pr-2703' into master
[java] Fix UnusedAssignment FP with methods throwing exceptions #2703
2020-08-13 12:23:56 +02:00
Andreas Dangel 9ec74d685e Merge branch 'pr-2702' into master
[java] Skip abstract methods in UnusedAssignment #2702
2020-08-13 11:39:31 +02:00
Andreas Dangel fdf652e032 [java] UnusedAssignment: ignore params of native methods 2020-08-13 10:40:45 +02:00
Andreas Dangel 241195c7bc Use https://chunk.io for uploading
Fixes #2711
2020-08-13 10:06:52 +02:00
Andreas Dangel 6277717dcf Update gems
Fixes CVE-2020-14001 (kramdown)
2020-08-13 09:48:07 +02:00
berkam 6df2edeaa7 fix false positive with lombok annotation EqualsAndHashCode 2020-08-09 19:19:16 +03:00
Clément Fournier 5564d89e18 Cleanup useless thing 2020-08-06 17:51:19 +02:00
Clément Fournier 65035d6e40 Update release notes, refs #2703 2020-08-06 17:45:07 +02:00
Clément Fournier 682fa0a3b3 Fix UnusedAssignment FP with methods throwing exceptions 2020-08-06 17:40:48 +02:00
Clément Fournier 9a9b79c9a4 Update release notes, refs #2702 2020-08-06 15:35:20 +02:00
Clément Fournier 7c9c6e128d Skip abstract methods in UnusedAssignment 2020-08-06 15:32:05 +02:00
Jan-Lukas Else 68656baee5 [java] Fix OnlyOneReturn code example 2020-08-06 14:39:40 +02:00
Andreas Dangel b01dc8371b [core] Backporting fixes from pmd7
LanguageFactory and LanguageRegistry are more
robust in case a single language can't
be loaded.
2020-08-06 11:29:05 +02:00
Andreas Dangel 5631a72922 [java] StringToString - compare subtypes of arguments/parameters 2020-08-06 11:14:56 +02:00
Mykhailo Palahuta 2d176f73ee [java] ProperCloneImplementation not valid for final class 2020-08-06 12:04:01 +03:00
Andreas Dangel 0a7d3ff922 Merge branch 'pr-2690'
[core] Fix java7 compatibility #2690
2020-08-06 10:25:48 +02:00
Andreas Dangel 420e3cb11c Merge branch 'pr-2691'
[core] Duplicate warning for missing language attribute #2691
2020-08-06 10:23:49 +02:00
Mykhailo Palahuta f1f004d765 [java] ExcessiveParameterListRule must ignore a private constructor 2020-08-04 13:12:02 +03:00
Clément Fournier b273774ea7 Merge branch 'kotlin-license-headers' into master 2020-08-03 23:00:17 +02:00
Clément Fournier 942ec01e8f Merge branch 'master' into kotlin-license-headers 2020-08-03 23:00:08 +02:00
Andreas Dangel 7833d6c35f [doc] Fix release notes jdoc typo for XmlXPathRule 2020-08-03 20:47:20 +02:00
Andreas Dangel 621e6ac052 Merge branch 'pr-2680'
[core] Deprecate report methods #2680
2020-08-03 20:46:37 +02:00
Andreas Dangel 0f4b11873c [doc] Update release notes, fixes #1962 2020-08-03 20:46:29 +02:00
Andreas Dangel 312863820c [java] Improve example for AvoidSynchronizedAtMethodLevel 2020-08-03 18:25:00 +00:00
Mykhailo Palahuta db8b1aebd3 CloseResource: close() should be in finally detection; try-with-resource var wrapping detection; wrapped type resolution fix 2020-08-03 17:14:44 +03:00
Clément Fournier 709ec484c6 Merge branch 'master' into deprecate-report-methods 2020-08-03 13:26:49 +02:00
Clément Fournier 1080d123c6 Merge branch 'master' into deprecate-report-methods 2020-08-03 13:23:17 +02:00
Clément Fournier 66efc90cb3 PR comments 2020-08-03 13:20:51 +02:00
Andreas Dangel 19918c6c51 [doc] Update release notes, fixes #2647 2020-08-02 17:54:18 +02:00
Andreas Dangel 8782eaeb1a Merge branch 'pr-2681'
[core] Deprecate DFA #2681
2020-08-02 17:04:44 +02:00
Andreas Dangel dafacf3d78 [doc] Use rule tags 2020-08-02 17:02:12 +02:00
Andreas Dangel 21d3bfc0c5 Merge branch 'pr-2676'
[core] Deprecate RuleContext attributes #2676
2020-08-02 16:56:38 +02:00
Andreas Dangel 40f954f81a Merge branch 'pr-2675'
[core] Deprecate parser options #2675
2020-08-02 16:53:24 +02:00
Andreas Dangel eb219916dc [doc] Update release notes 2020-08-02 16:50:04 +02:00
Andreas Dangel 54637c60ec [core] Remove dependency to commons text, it is actually not needed
Escaping in CDATA section is not necessary.
2020-08-02 12:28:21 +02:00
Mykhailo Palahuta eca547b505 UnnecessaryCaseChangeRule: nested expressions traversing fix 2020-08-02 00:54:27 +03:00
Andreas Dangel 6024484539 [doc] Update release notes, refs #2690 2020-08-01 18:17:43 +02:00
Andreas Dangel 4cf9f5904a [core] Fix java7 compatibility
* Scala also requires java8 and it failed indirectly via a
  ServiceConfigurationError while discovering the language.
  Scala's dependencies require java8.
* Downgrade JCommander for java7 compatibility
* Downgrade commons-text for java7 compatibility
* Add integration test
2020-08-01 17:53:45 +02:00
Mykhailo Palahuta 33e0239243 StringToString: return type null check 2020-08-01 15:59:00 +03:00
Mykhailo Palahuta 32a8c042e3 StringToString: NPE at method param type fix 2020-08-01 15:13:20 +03:00
Andreas Dangel 1c6bd4e715 Move common config to parent pom 2020-07-31 22:43:52 +02:00
Andreas Dangel acf58f1887 Check for license headers in kotlin source files 2020-07-31 20:26:27 +02:00
Clément Fournier df5d3d2afd Only warn if warnDeprecated 2020-07-31 17:49:05 +02:00
Andreas Dangel fc99e92a7e [ci] When releasing, wait for maven central sync 2020-07-31 14:11:30 +02:00
Andreas Dangel 58d92add5f Update gems 2020-07-31 14:08:28 +02:00
Andreas Dangel 8a7ec4b4e3 [ci] Avoid bundle warnings about --path 2020-07-31 14:08:20 +02:00
Andreas Dangel f975ebf7b3 [java] AvoidReassigningCatchVariables: fix missing lang attr, add to quickstart 2020-07-31 12:34:50 +02:00
Andreas Dangel 22c3ce92ce [doc] Update release notes, fixes #2663 2020-07-31 12:28:29 +02:00
Andreas Dangel 08b922429c [java] Catch possible LinkageErrors for other rules 2020-07-31 12:23:59 +02:00
Andreas Dangel 693613a6a8 [java] ImportWrapper - catch and report LinkageErrors 2020-07-31 12:13:24 +02:00
Andreas Dangel 4ce394eca3 [java] ImportWrapper - only consider static fields/methods
Fixes #2663
2020-07-31 11:45:17 +02:00
Andreas Dangel 91579173fd [java] Formatting of rule doc of AvoidReassigningCatchVariables 2020-07-31 11:12:57 +02:00
Andreas Dangel 9b6dcfef3a Merge branch 'pr-2682'
[java] New Rule: AvoidReassigningCatchVariables #2682
2020-07-31 11:00:18 +02:00
Andreas Dangel c447319fbe [doc] Update release notes and new rules
Fixes #2471
Refs #2682
2020-07-31 10:59:00 +02:00
Andreas Dangel 207d9c544c Merge branch 'pr-2679'
[java] InvalidLogMessageFormatRule throws IndexOutOfBoundsException when only logging exception message #2679
2020-07-31 10:52:56 +02:00
Andreas Dangel ab044f2c32 [doc] Update release notes, fixes #2431, refs #2679 2020-07-31 10:52:10 +02:00
Andreas Dangel c50f36e2ce Merge branch 'pr-2678'
[java] AvoidCatchingThrowable can not detect the case: catch (java.lang.Throwable t) #2678
2020-07-31 10:37:34 +02:00
Andreas Dangel df2e5bfc67 [doc] Update release notes, refs #2678, fixes #2439 2020-07-31 10:36:13 +02:00
Mykhailo Palahuta b48da45701 [java] StringToString can not detect the case: getStringMethod().toString() 2020-07-31 10:57:03 +03:00
Andreas Dangel d8642de069 Merge branch 'pr-2670'
[java] UnusedAssignment false positive with leaking this in constructor #2670
2020-07-30 21:46:55 +02:00
Andreas Dangel 6485852861 [doc] Update release notes, fixes #2668 2020-07-30 21:46:10 +02:00
Mykhailo Palahuta b205806124 UnnecessaryCaseChangeRule: violation reporting fix 2020-07-30 13:22:02 +03:00
Andreas Dangel a5eb60243d [java] Deprecate ASTThrowStatement#getFirstClassOrInterfaceTypeImage()
Refs #2665
2020-07-30 11:37:29 +02:00
Andreas Dangel 5bff6ac52e Merge branch 'pr-2657'
[lang-test] Upgrade kotlintest to Kotest #2657
2020-07-30 10:31:43 +02:00
Andreas Dangel b5315f556c [doc] Update release notes, fixes #2653 2020-07-30 10:30:53 +02:00
Andreas Dangel eb683569af Merge branch 'pr-2617'
[core] Deprecate missing language attribute on rule definition #2617
2020-07-30 10:19:03 +02:00
Andreas Dangel e663d5dd9b [doc] Update release notes, fixes #724 2020-07-30 10:18:18 +02:00
Andreas Dangel 3621bc3069 [doc] Update writing rules intro for explaining language attribute 2020-07-30 10:14:53 +02:00
Mykhailo Palahuta bd2cd1b263 [java] AvoidReassigningCatchVariables 2020-07-29 20:20:22 +03:00
Clément Fournier 34d961b794 Deprecate ReadableDuration 2020-07-29 17:45:19 +02:00
Clément Fournier dda3e14fc5 Merge branch 'red_field_init' 2020-07-29 15:02:11 +02:00
Clément Fournier 6fd5d7c66b Merge branch 'master' into red_field_init 2020-07-29 15:00:46 +02:00
Clément Fournier df62984eb0 Update release notes, refs #2677 2020-07-29 14:59:48 +02:00
Clément Fournier 658efc4fe3 Update release notes 2020-07-29 00:03:53 +02:00
Clément Fournier 01512447af Deprecate framework in plsql 2020-07-28 23:48:30 +02:00
Clément Fournier 520711a773 Deprecate framework in core 2020-07-28 23:47:05 +02:00
Clément Fournier 091bff7793 Deprecate java stuff 2020-07-28 23:43:47 +02:00
Clément Fournier 772bc1346c Deprecate more things 2020-07-28 23:34:01 +02:00
Mykhailo Palahuta c0eba42f29 [java] InvalidLogMessageFormatRule throws IndexOutOfBoundsException when only logging exception message 2020-07-28 18:57:29 +03:00
Mykhailo Palahuta 91b942b1dc [java]AvoidCatchingThrowable can not detect the case: catch (java.lang.Throwable t) 2020-07-28 17:11:14 +03:00
Clément Fournier ce32573090 Deprecate more methods 2020-07-28 14:55:01 +02:00
Mykhailo Palahuta a707d94513 [java] RedundantFieldInitializer can not detect a special case for char initialize: char foo = '\0'; 2020-07-28 15:54:01 +03:00
Clément Fournier f62a411a45 Deprecate some Report methods 2020-07-28 14:48:02 +02:00
Clément Fournier 7ab1ab0a76 Deprecate some methods on RuleContext 2020-07-28 14:40:53 +02:00
Clément Fournier 0609aac9d3 Deprecate AbstractParser 2020-07-28 14:36:20 +02:00
Clément Fournier 8fe29dfee7 Deprecations in XML module 2020-07-28 14:26:07 +02:00
Clément Fournier 25d59beb37 Revert changes to apex rules
Someone may be using those properties, this would
be a breaking change
2020-07-28 14:26:06 +02:00
Clément Fournier 151a56cfa0 Deprecate other custom XPath rules 2020-07-28 14:26:06 +02:00
Clément Fournier 190addc1a9 Replace usages of ApexXPathRule 2020-07-28 14:26:05 +02:00
Clément Fournier 9a37ab4962 Deprecate parser options in some places
There is no way to introduce the new API
in a binary compatible change, so LVHandler::getDefaultParserOptions,
LVHandler::getParser and Parser::parse
will remain like this until 7.0 and be
broken.
2020-07-28 14:25:51 +02:00
berkam 0fbd12ae67 add lombok.EqualsAndHashCode in AbstractLombokAwareRule 2020-07-28 15:06:10 +03:00
Mykhailo Palahuta 58c55d07ed CloseResource: addCloseResourceViolation fix 2020-07-28 10:58:45 +03:00
Mykhailo Palahuta aa3271978f CloseResource: a method call as an allocation argument bug fix 2020-07-27 23:45:02 +03:00
Mykhailo Palahuta 4bb3759371 [java] CloseResource false positive when resource included in return value 2020-07-27 20:00:45 +03:00
Clément Fournier c737b194f5 Ignore threading
We consider that reaching field defs are observable
at the point of the leak. But we assume the ctor
executes atomically, so following def chains work
normally.

Maybe, if the field is volatile, we should be more
conservative and assume that all its assignments after
any leak are observable. This looks very rare though
2020-07-27 17:02:22 +02:00
Clément Fournier 554c8031ee Handle this reference leak in ctor 2020-07-27 16:15:47 +02:00
kenji 4a6bc933e1 Manage swift5 string literals 2020-07-27 11:47:26 +02:00
Andreas Dangel fe82f6a448 Dogfood - update PMD to 6.26.0, update build-tools 2020-07-25 15:27:24 +02:00
Andreas Dangel 9c141bd9b2 Prepare next development version 2020-07-25 13:47:02 +02:00
Andreas Dangel 49ab75aeb7 [maven-release-plugin] prepare for next development iteration 2020-07-25 13:45:36 +02:00
Andreas Dangel a9632e2a06 [maven-release-plugin] prepare release pmd_releases/6.26.0 2020-07-25 13:45:27 +02:00
Andreas Dangel aba1b3399a Prepare pmd release 6.26.0 2020-07-25 13:36:28 +02:00
Andreas Dangel 8a6975f8ec [apex] Improve AST for try-catch-finally statements 2020-07-24 16:55:48 +02:00
Mykhailo Palahuta d69520f68f UnnecessaryCaseChangeRule: NullPointerException in constructor fix 2020-07-24 12:46:56 +03:00
Andreas Dangel 6464b349cf [jsp] Remove usage of deprecated ImportWrapper (#2658) 2020-07-24 11:38:37 +02:00
Mykhailo Palahuta b8d878b401 [java] UnnecessaryCaseChange can not detect the case like: foo.equals(bar.toLowerCase()) 2020-07-24 11:25:14 +03:00
Andreas Dangel 900635b664 [apex] Update jorje lib to 2020-06-04-ba31c0 2020-07-24 10:23:23 +02:00
Andreas Dangel 0738797738 Merge branch 'pr-2658'
[core][java] Deprecate pmd-core::lang.rule.ImportWrapper #2658
2020-07-24 09:47:32 +02:00
Andreas Dangel e4b2c4ccbd Merge branch 'pr-2632'
[java] ArrayIsStoredDirectly false positive with private constructor/… #2632
2020-07-24 09:45:29 +02:00
Andreas Dangel 4444ef279d Merge branch 'pr-2631'
[java] NPathComplexity can't handle switch expressions #2631
2020-07-24 09:42:58 +02:00
Andreas Dangel b2418a99bf Update guava 2020-07-24 09:33:13 +02:00
Clément Fournier fb6ec96bad Merge branch 'issue-2546' 2020-07-23 15:52:58 +02:00
Clément Fournier 2fad9acfbd Merge branch 'master' into issue-2546 2020-07-23 15:52:30 +02:00
Clément Fournier 77934a26b7 Merge branch 'issue-2598' 2020-07-23 15:51:25 +02:00
Clément Fournier 6f9aedfaeb Merge branch 'master' into issue-2598 2020-07-23 15:51:13 +02:00
Clément Fournier d5a3ffe387 Merge branch 'issue-2181' 2020-07-23 15:50:26 +02:00
Clément Fournier fce20e0b7c Merge branch 'master' into issue-2181 2020-07-23 15:49:54 +02:00
Clément Fournier 6a9a834c67 Same for NPath 2020-07-23 14:51:26 +02:00
Clément Fournier 9a47d658e6 Handle switch exprs properly 2020-07-23 14:42:29 +02:00
Clément Fournier fbeaa5bc74 Merge branch 'master' into issue-2625 2020-07-23 14:26:33 +02:00
Clément Fournier 6fdfac23c8 Merge branch 'issue-2615' 2020-07-23 14:16:04 +02:00
Clément Fournier d239987d26 Merge branch 'master' into issue-2615 2020-07-23 14:15:47 +02:00
Andreas Dangel 55a6b5bef5 [doc] Fix unit tests on Windows 2020-07-23 13:53:52 +02:00
Andreas Dangel 8c06dbcd4c [doc] Improve performance of rule doc generator
Now we walk PMD source tree only once to resolve the
file names to rulesets and rules instead walking the
whole tree again for each ruleset/rule.
2020-07-23 13:03:19 +02:00
Andreas Dangel 6ee17d44f7 [doc] Fix javadoc in release notes for constructor 2020-07-23 11:44:39 +02:00
Andreas Dangel 62666213ba Deprecate pmd-core::lang.rule.ImportWrapper 2020-07-23 11:15:03 +02:00
Andreas Dangel 5c1a11c0b4 Merge branch 'pr-2652'
[java] UseCollectionIsEmpty can not detect the case this.foo.size() #2652
2020-07-23 10:47:02 +02:00
Andreas Dangel f1fa375341 [doc] Update release nots, fixes #2543, refs #2652 2020-07-23 10:45:56 +02:00
Andreas Dangel 6b44e326ce [java] UseCollectionIsEmpty: improve test cases 2020-07-23 10:44:22 +02:00
Andreas Dangel ed77b3dc46 Merge branch 'pr-2651'
[java] False negative: LiteralsFirstInComparisons for methods... (2569) #2651
2020-07-23 10:15:09 +02:00
Andreas Dangel 7b1ccf4837 [doc] Update release notes, fixes #2569, refs #2651 2020-07-23 10:13:40 +02:00
Andreas Dangel 66d243efa1 [java] LiteralsFirstInComparison: additional test case 2020-07-23 10:10:26 +02:00
Andreas Dangel 7941d8d610 Merge branch 'master' into issue-2625 2020-07-23 09:57:57 +02:00
Andreas Dangel 677bfd4ae4 [java] Added additional test case for CycloMetric
And fixed comments in test cases

Refs #2631
2020-07-23 09:46:50 +02:00
Mykhailo Palahuta c351314f30 LiteralsFirstInComparisonsRule: ignore two string literals comparison 2020-07-22 13:46:08 +03:00
Maikel Steneker f03fab409a Add test case for SQL tab width 2020-07-22 10:29:17 +02:00
Maikel Steneker 1537936170 Remove accidentally committed file 2020-07-22 10:24:43 +02:00
Andreas Dangel d03640b25e Merge branch 'pr-2641'
[java] AvoidThrowingNullPointerException marks all NullPointerException… #2641
2020-07-21 19:57:29 +02:00
Andreas Dangel 69888847b6 [doc] Update release notes, fixes #2580, refs #2641 2020-07-21 19:56:33 +02:00
Mykhailo Palahuta 892b16c805 AvoidThrowingNullPointerException: isNullPointerException usage fix 2020-07-21 15:56:44 +03:00
Mykhailo Palahuta 68f90687af AvoidThrowingNullPointerException: NPE instances tracking fix 2020-07-21 14:54:23 +03:00
Clément Fournier 2e9f5ad897 Merge branch 'master' into issue-2615 2020-07-20 16:36:16 +02:00
Clément Fournier 6d73eaf3c7 Fix custom parser spec
Add kotest-runner-junit5-jvm as a dependency,
in pmd-java. This makes kotest discoverable
as Junit tests, which IDEs can pick up on (at
least IntelliJ does).

Update kotlin version to latest stable (1.3.72)
2020-07-20 16:33:29 +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
Clément Fournier 68ae318f02 Update to kotest 2020-07-20 00:12:40 +02:00
Andreas Dangel 25405eb870 Merge branch 'pr-2643'
[java] AvoidCallingFinalize detects some false positives (2578) #2643
2020-07-17 20:30:01 +02:00
Andreas Dangel 6b69964733 [doc] Update release notes, refs #2643, fixes #2578 2020-07-17 20:29:11 +02:00
Andreas Dangel db21d589d4 [java] AvoidCallingFinalizeRule - use rulechain
And improve tests
2020-07-17 20:28:55 +02:00
Andreas Dangel 585b9099ca Merge branch 'pr-2640'
[java] NullPointerException in rule ProperCloneImplementation #2640
2020-07-17 19:47:30 +02:00
Andreas Dangel 74bb4f6434 [doc] Update release notes, refs #2640, fixes #2634 2020-07-17 19:46:41 +02:00
Mykhailo Palahuta 74fb7ba1fb [java] UseCollectionIsEmpty can not detect the case this.foo.size() (2543) 2020-07-17 16:30:37 +03:00
Andreas Dangel 044d7aea2d Merge branch 'pr-2638'
[visualforce] add new safe resource for VfUnescapeEl #2638
2020-07-17 15:29:25 +02:00
Andreas Dangel eca87a0de4 Merge branch 'pr-2624'
[core] Compatibility measures for rulechain simplification #2624
2020-07-17 15:27:58 +02:00
Andreas Dangel 666621e958 Fix checkstyle 2020-07-17 15:16:29 +02:00
Andreas Dangel 7b3d31246e Merge branch 'master' into pr-2624 2020-07-17 15:16:24 +02:00
Andreas Dangel e4690cb56a Fix compile errors for CPD only languages 2020-07-17 15:04:43 +02:00
Andreas Dangel 7ae424a35b Add deprecation javadocs 2020-07-17 14:43:43 +02:00
Andreas Dangel e24a26e211 Merge branch 'pr-2629'
[all] Dependencies cleanup #2629
2020-07-17 12:07:03 +02:00
Andreas Dangel fc3ee5375b [doc] Update release notes, fixes #710 2020-07-17 12:05:06 +02:00
Andreas Dangel 94afdb117d Add test engines as surefire plugin dependencies
This removes junit-vintage-engine as a test dependency
as well as kotlintest-runner-junit5.
The engines are only needed during test execution, but should
not be available for test compilation.

For this to work, the latest surefire plugin is required.
2020-07-17 12:03:45 +02:00
Mykhailo Palahuta 01e48c882b AvoidCallingFinalize: expected lines added to test 2020-07-17 11:05:55 +03:00
Andreas Dangel 05933c646e [apex] AvoidSoqlInLoops false positive for SOQL with in For-Loop
Fixes #2598
2020-07-16 20:13:53 +02:00
Andreas Dangel 9887d5a387 Merge branch 'pr-2618'
[java] New rule: UnusedAssignment #2618
2020-07-16 19:56:22 +02:00
Andreas Dangel 88ac918e4f [java] UnusedAssignmentRule - add rule chain visit 2020-07-16 19:53:41 +02:00
Andreas Dangel a8a3fccdf5 [doc] Update release notes, new rule UnusedAssignment 2020-07-16 19:22:38 +02:00
Andreas Dangel b2ca700328 Merge branch 'pr-2597'
[dependencies] Fix issue #2594, update exec-maven-plugin everywhere #2597
2020-07-16 18:51:18 +02:00
Andreas Dangel 59acd6d969 Revert "Use xmlint to get the pom version"
This reverts commit 34f185b03a.
2020-07-16 18:46:40 +02:00
Andreas Dangel 17e57633b5 Merge branch 'master' into pr-2597 2020-07-16 18:25:59 +02:00
Andreas Dangel 2adc457d23 [doc] Update release notes, refs #2597, fixes #2594 2020-07-16 18:23:37 +02:00
Andreas Dangel 34f185b03a Use xmlint to get the pom version 2020-07-16 18:21:26 +02:00
Andreas Dangel bb005ea5d4 Refactor exec-maven-plugin version and usage 2020-07-16 18:21:26 +02:00
Mykhailo Palahuta 9bbb6aab4d AvoidCallingFinalize: constructor false negative fix 2020-07-16 19:21:22 +03:00
Andreas Dangel 9180b479cb [apex] Remove profile designer, which started the deprecated designer
Users are encouraged to use https://github.com/pmd/pmd-designer instead.
2020-07-16 18:20:43 +02:00
Andreas Dangel 9168a76e84 Merge branch 'pr-2610'
[apex] Support top-level enums in rules #2610
2020-07-16 17:47:48 +02:00
Andreas Dangel 35856a1064 [doc] Update release notes, refs #2610 2020-07-16 17:47:05 +02:00
Andreas Dangel 749818a903 Merge branch 'pr-2560'
[java] Fix false positives of LawOfDemeter: this and cast expressions #2560
2020-07-16 17:34:42 +02:00
Mykhailo Palahuta a3670e4135 [java] False negative: LiteralsFirstInComparisons for methods returning Strings (2569) 2020-07-16 18:10:36 +03:00
Andreas Dangel 80103ab52a [java] LawOfDemeter: False positive with indexed array access
Fixes #2181
2020-07-16 13:56:53 +02:00
Andreas Dangel 24af109454 Merge branch 'master' into pr-2560 2020-07-16 13:17:45 +02:00
Andreas Dangel 836c272975 [doc] Update release notes, refs #2560, fixes #2174, fixes #2189 2020-07-16 13:14:17 +02:00
Andreas Dangel 693c870f28 [java] LawOfDemeter - add test cases 2020-07-16 13:12:17 +02:00
Andreas Dangel 68b55a7dd2 [ci] Update java to 11.0.8+10 2020-07-16 11:39:11 +02:00
Mykhailo Palahuta 65e37cadca AvoidThrowingNullPointerException: addViolation usage fix 2020-07-16 12:37:01 +03:00
Andreas Dangel 6d4d3b20fc [java] DuplicateImports - fix false positive with static import
Fixes #2546
2020-07-16 11:24:57 +02:00
Mykhailo Palahuta 2eedff056c AvoidCallingFinalize: addViolation, getArgsCount fix 2020-07-16 11:55:09 +03:00
Andreas Dangel 04764402b9 Merge branch 'pr-2558'
[java] Fix issue #1736 and issue #2207 #2558
2020-07-16 10:43:42 +02:00
Andreas Dangel a60615f542 [java] AvoidInstantiatingObjectsInLoopsRule - add test case for fixed FN
By changing this rule to use rule chain, this FN for anonymous classes
has been fixed as well.
2020-07-16 10:39:30 +02:00
Mykhailo Palahuta 5a6e3d609e [java]AvoidCallingFinalize detects some false positives (2578) 2020-07-15 15:44:54 +03:00
Mykhailo Palahuta 061c9656cc [java]AvoidThrowingNullPointerException marks all NullPointerException objects as wrong, whether or not thrown (2580) 2020-07-14 15:53:26 +03:00
Mykhailo Palahuta 782cb9d262 [java] NullPointerException in rule ProperCloneImplementation 2020-07-14 14:00:42 +03:00
Andreas Dangel 1ca84d56c1 Merge branch 'pr-2590'
Update libraries snyk is referring to as `unsafe` #2590
2020-07-13 20:09:23 +02:00
Andreas Dangel 2032bb4477 [doc] Update release notes, refs #2590 2020-07-13 20:08:40 +02:00
Andreas Dangel cc408d2876 [java] AvoidInstantiatingObjectsInLoopsRule - fix false negative 2020-07-13 20:00:46 +02:00
Andreas Dangel cc495f180c [doc] Update release notes, refs #2558
Fixes #1736
Fixes #2207
2020-07-09 19:00:59 +02:00
Andreas Dangel c5364a81f8 [java] Fix and simplify AvoidInstantiatingObjectsInLoopsRule 2020-07-09 18:55:10 +02:00
Andreas Dangel e48489450f [java] Add test for #2207: AvoidInstantiatingObjectsInLoops false positives 2020-07-09 18:54:53 +02:00
Andreas Dangel 8766d54a07 [java] Fix and simplify UseStringBufferForStringAppendsRule 2020-07-09 16:08:30 +02:00
Andreas Dangel 6f6f87c7dc [java] Add test for #1736: UseStringBufferForStringAppends false positive 2020-07-09 15:21:36 +02:00
Young Chan e6c32ecbaa Update UseStringBufferForStringAppendsRule.java 2020-07-09 15:12:32 +02:00
Young Chan b782575951 Update AvoidInstantiatingObjectsInLoopsRule.java 2020-07-09 15:12:32 +02:00
Young Chan 6cff647681 fix issue #2207 2020-07-09 15:11:03 +02:00
Young Chan f5ccc94130 fix issue #1736 2020-07-09 15:11:00 +02:00
Young Chan 11a0ec51fd fix issue 1736 2020-07-09 15:10:40 +02:00
Andreas Dangel d89a6d080d [visualforce] Add test for VfUnescapeEl with $MessageChannel 2020-07-09 12:20:09 +02:00
Peter Chittum 2fb196b16a [visualforce] added new global variable name to safe resources
Cherry-picked from 7f0f91f71a
2020-07-09 12:19:54 +02:00
Peter Chittum 5e50b16e05 [visualforce] added new global variable name to safe resources
Cherry-picked from 25cb8de645
2020-07-09 12:19:38 +02:00
Andreas Dangel e6600ec856 [core] Provide StringUtil.removeInvalidXml10Characters
And use it in both CPD/PMD XMLRenderers.
2020-07-09 11:07:06 +02:00
Andreas Dangel 2e006697e0 [core] Refactor XMLRenderer to use XMLStreamWriter
In order to properly support different encodings, a OutputStream
is needed. Then Java will take care of unmappaple characters
and encode them as entities for XML.

For backwards compatibility, a writer is still created and exposed.
2020-07-09 10:56:44 +02:00
Andreas Dangel bb97b693f2 Update pmd-regression-tester 1.0.1 2020-07-08 20:29:26 +02:00
Andreas Dangel 53c581b69a Update pmd-regression-tester 2020-07-06 21:44:47 +02:00
Clément Fournier c25e10717b Fix construction of rulechain visitor
Ctor needs to be public, because RuleChain
builds them from a class
2020-07-06 15:53:52 +02:00
Clément Fournier 7ccec3bcef Merge branch 'master' into deprecate-set-lang-in-java 2020-07-06 14:02:46 +02:00
Clément Fournier 8add323403 Fix other offenders 2020-07-06 14:02:21 +02:00
Clément Fournier b710465411 Fix warning 2020-07-06 13:54:10 +02:00
Clément Fournier eac96a433a Fix remaining usages of old ctor 2020-07-06 13:50:32 +02:00
Clément Fournier 96998fffc2 Same for modelica 2020-07-06 13:35:06 +02:00
Clément Fournier 03d03440b4 Declare junit dependencies before kotlintest ones
This is for the scala modules. Apparently
in the other order, only kotlin tests are
run.
2020-07-06 13:25:54 +02:00
Clément Fournier c93414d7b5 Merge branch 'java-dummy-node' 2020-07-06 13:06:56 +02:00
Andreas Dangel 0bd9b1db6b [core] XMLRenderer - avoid unmappable characters for non UTF-8 encodings 2020-07-05 22:10:14 +02:00
Andreas Dangel 60f905b0ef [doc] Update release notes, fixes #2615 2020-07-05 14:46:04 +02:00
Andreas Dangel d927973244 [core] PMD XMLRenderer - correctly support encoding
The XMLRenderer uses by default UTF-8 encoding, but the
writer uses the system default encoding, which doesn't work
well together.

Provide new experimental API Renderer::setReportFile, so that
renderer implementations can create their own writers.
The default implementation in AbstractRenderer is backwards compatible.
2020-07-05 14:21:46 +02:00
Andreas Dangel 3bb091e26d [core] CPD: Also escape filename, explicitly set XML 1.0 2020-07-05 11:20:17 +02:00
Andreas Dangel 3004e76257 [core] CPD: Add correct XML 1.0 escaping for code snippets 2020-07-03 21:11:57 +02:00
Andreas Dangel 06ce559934 [java] ArrayIsStoredDirectly false positive with private constructor/methods
Fixes #2622
2020-07-03 20:17:17 +02:00
Andreas Dangel 25bfb9d909 [java] Support switch labels/rules/expressions for CYCLO 2020-07-03 19:57:12 +02:00
Andreas Dangel db675c37d9 [java] NPathComplexity can't handle switch expressions
Fixes #2625
2020-07-03 19:57:09 +02:00
Clément Fournier e8d749dc5e Merge branch 'issue-2626' 2020-07-03 16:30:16 +02:00
Andreas Dangel 1fb085f7ab Use StringUtils.equalsIgnoreCase 2020-07-03 11:58:38 +02:00
Andreas Dangel 147f1ac053 [apex] UnusedLocalVariable - false positive on case insensitivity allowed in Apex
Fixes #2626
2020-07-02 22:39:17 +02:00
Andreas Dangel c24efea939 Revert to use stable maven-dependency-plugin 2020-07-02 21:41:19 +02:00
Andreas Dangel 67f33e3427 Add back hamcrest (it's actually test-runtime) 2020-07-02 21:00:43 +02:00
Andreas Dangel 373c9b0944 Fix scala library versions 2020-07-02 20:30:54 +02:00
Andreas Dangel 370c0b0b6d Remove unused dependency, explicitly declare used dependencies 2020-07-02 15:12:31 +02:00
Andreas Dangel 80d9e18011 pmd-lang-test: clarify dependencies 2020-07-02 14:16:39 +02:00
Andreas Dangel c7ccb8a087 javacc is only needed during parser generation 2020-07-02 10:27:26 +02:00
Andreas Dangel 43dd6567e2 [java] Update test dependency log4j
This fixes https://github.com/advisories/GHSA-vwqq-5vrc-xw9h
2020-07-02 10:13:08 +02:00
Andreas Dangel f4bf540bc3 [java] Remove usages of DummyJavaNode 2020-07-02 09:48:23 +02:00
Clément Fournier 835b9c7e5b Update release notes
Adjust the jdoc liquid tag to handle varargs
and constructors
2020-07-01 11:46:16 +02:00
Clément Fournier 49635c2a66 Deprecate Rulechain visitors 2020-07-01 11:27:38 +02:00
Clément Fournier 659066ee02 Deprecate BaseLanguageModule constructor 2020-07-01 11:27:38 +02:00
Clément Fournier d7f96e08d9 Uniformize apply across languages 2020-07-01 11:27:38 +02:00
Robert Sösemann 26db700884 Merge pull request #2623 from pmd/revert-2621-master
Revert "[visualforce] add new safe resource for VfUnescapeEl" because not all required steps were done.
2020-06-30 14:38:55 +02:00
Robert Sösemann 715626bfc4 Revert "[visualforce] add new safe resource for VfUnescapeEl" 2020-06-30 14:37:14 +02:00
Robert Sösemann d84736cacc Merge pull request #2621 from pchittum/master
[visualforce] add new safe resource for VfUnescapeEl
2020-06-30 14:30:23 +02:00
Peter Chittum 7f0f91f71a added new global variable name to safe resources 2020-06-30 08:18:45 +01:00
Peter Chittum 25cb8de645 added new global variable name to safe resources 2020-06-30 08:15:25 +01:00
Clément Fournier 556685de1b Remove changes to VariableNameDeclaration
Probably this is what causes DFAAR to change
behavior. The current behavior is wrong (two
variables are not equal just from their name,
that doesn't account for whether they're declared
independently or shadow a declaration). But
whatever, this will be scrapped in 7.0
2020-06-28 18:41:42 +02:00
Clément Fournier e04223356b Merge branch 'master' into new-rule-UnusedAssignment 2020-06-28 18:19:40 +02:00
Clément Fournier 8c30440843 Move to bestpractices.xml 2020-06-28 18:15:04 +02:00
Clément Fournier 734da43fbf Ignore vars that start with "ignore" 2020-06-28 18:11:14 +02:00
Clément Fournier 82995fbe07 Fix unused formal value FN 2020-06-28 17:57:45 +02:00
Clément Fournier a6d9d595dd Add test case for unused var 2020-06-28 17:26:23 +02:00
Clément Fournier 546c525ad0 Shorten messages a bit 2020-06-28 17:08:35 +02:00
Clément Fournier 3d7aaf7cda Fix FPs with reportUnusedVariables & foreach vars 2020-06-28 17:03:57 +02:00
Clément Fournier 388e29a9de Fix unused exception in loop 2020-06-28 16:35:53 +02:00
Clément Fournier 105f1a13a1 Implement loop condition flow 2020-06-28 02:22:06 +02:00
Clément Fournier 49f775be83 Disable reporting of unused vars by default 2020-06-28 00:26:22 +02:00
Clément Fournier 4207c36740 Fix some bugs 2020-06-27 23:34:29 +02:00
Clément Fournier b049541126 Fix pmd warnings 2020-06-27 22:19:13 +02:00
Clément Fournier 596f27bf93 Checkstyle 2020-06-27 19:50:18 +02:00
Clément Fournier 36b0f83158 Make sure DFA issues are fixed
Refs #1304, #399, #400, #1107, #1251, #1606, #1675, #1682, #2131
2020-06-27 19:08:50 +02:00
Clément Fournier b0891dfca3 Refactor 2020-06-27 18:21:39 +02:00
Clément Fournier 2dc8675b85 Doc 2020-06-27 18:21:39 +02:00
Clément Fournier b7c09a9555 Suppress some overlap with UnusedVariable 2020-06-27 18:21:39 +02:00
Clément Fournier 58adfca79f Fix parenthesized expressions 2020-06-27 18:21:39 +02:00
Clément Fournier 1d022d3d91 Fix FP with side-effect in toplevel condition 2020-06-27 18:21:39 +02:00
Clément Fournier c837e244e9 Handle shortcut boolean expressions in if/ternary 2020-06-27 18:21:39 +02:00
Clément Fournier cb09b6b9be Test local/anon class 2020-06-27 18:21:39 +02:00
Clément Fournier 496f7653c6 Special case pre-increment if value is used 2020-06-27 18:21:39 +02:00
Clément Fournier 96e96406ff Better messages 2020-06-27 18:21:39 +02:00
Clément Fournier 5fe97ee9ca Add tests 2020-06-27 18:21:39 +02:00
Clément Fournier 776bf0990c React to @SuppressWarnings("unused") 2020-06-27 18:21:39 +02:00
Clément Fournier e0e2d8de6c Fix foreach bug 2020-06-27 18:21:39 +02:00
Clément Fournier 3a036c4933 FN with ctor var shadowing 2020-06-27 18:21:39 +02:00
Clément Fournier 46ae538b18 Fix some FPs 2020-06-27 18:21:39 +02:00
Clément Fournier d9a9a83caf Handle field initializers and ctors 2020-06-27 18:21:39 +02:00
Clément Fournier b7e5cb0182 Refactor 2020-06-27 18:21:39 +02:00
Clément Fournier 32392ed27e Lambda bug 2020-06-27 18:21:39 +02:00
Clément Fournier e228e5590f Improve finally 2020-06-27 18:21:39 +02:00
Clément Fournier 972610fe89 Try/catch 2020-06-27 18:21:39 +02:00
Clément Fournier 9f54f2715e Change terminology 2020-06-27 18:21:39 +02:00
Clément Fournier 069287e9e1 Better messages 2020-06-27 18:21:39 +02:00
Clément Fournier aee18faae3 Named labels 2020-06-27 18:21:39 +02:00
Clément Fournier b6dd5ad425 Simplify 2020-06-27 18:21:39 +02:00
Clément Fournier fec7a3b14b REVERT code to check for unused variables 2020-06-27 18:21:39 +02:00
Clément Fournier 990b39c472 Handle labeled loops 2020-06-27 18:21:39 +02:00
Clément Fournier 5cebe5d5ec Consider inc/decrement expressions 2020-06-27 18:21:38 +02:00
Clément Fournier 75b5fbf62b Continue statement 2020-06-27 18:21:38 +02:00
Clément Fournier e771242597 Switch 2020-06-27 18:21:38 +02:00
Clément Fournier d0a96e7808 Finish loops 2020-06-27 18:21:38 +02:00
Clément Fournier 2448cc73ce Handle break 2020-06-27 18:21:38 +02:00
Clément Fournier 138698be0a Handle while loop 2020-06-27 18:21:38 +02:00
Clément Fournier e8bd8c1d71 Fix conditional flow 2020-06-27 18:21:38 +02:00
Clément Fournier dd0532f095 Add UnusedAssignment to replace data flow rule 2020-06-27 18:21:38 +02:00
Clément Fournier 86e56213be Update release notes 2020-06-27 18:13:21 +02:00
Clément Fournier 3dd49db9cc Reorder attributes
(name first)
2020-06-27 18:08:30 +02:00
Clément Fournier 50cd4668a8 Fix apex rules 2020-06-27 17:59:20 +02:00
Clément Fournier 15dbd03061 Fix missing lang attributes in ruleset tests 2020-06-27 17:59:20 +02:00
Clément Fournier 6001ba232e Fix ruleset name for anonymous rsets 2020-06-27 17:59:20 +02:00
Clément Fournier a2506692b9 Fix vm rules 2020-06-27 17:59:20 +02:00
Clément Fournier 2fac2df551 Format ruleset tests 2020-06-27 17:59:19 +02:00
Clément Fournier df43a9108c Add warning for missing language attribute
Also, avoid parsing rulesets multiple times,
otherwise the warning is duplicated
2020-06-27 17:59:19 +02:00
Andreas Dangel 3f2bf0f596 Use pmd 6.25.0 2020-06-27 14:03:07 +02:00
Andreas Dangel bb26df6adf Prepare next development version 2020-06-27 11:33:02 +02:00
Andreas Dangel 95d8e80c1b [maven-release-plugin] prepare for next development iteration 2020-06-27 11:31:27 +02:00
Andreas Dangel a219b2e1be [maven-release-plugin] prepare release pmd_releases/6.25.0 2020-06-27 11:31:16 +02:00
Andreas Dangel 820a43f9c9 Prepare pmd release 6.25.0 2020-06-27 11:21:15 +02:00
Andreas Dangel 842bdb000c Merge branch 'pr-2609'
[core] Deprecate support for List attributes with XPath 2.0 #2609
2020-06-26 18:04:15 +02:00
Andreas Dangel acbbbee685 Merge branch 'pr-2608'
[apex][plsql][java] Deprecate base rule classes #2608
2020-06-26 18:01:30 +02:00
Andreas Dangel 3831a8589c Merge branch 'pr-2574'
[java] New Performance Rule UseIOStreamsWithApacheCommonsFileItem #2574
2020-06-26 17:58:49 +02:00
Andreas Dangel 91868f3156 Deprecations for #2490 2020-06-26 10:37:24 +02:00
Andreas Dangel 9508a92c2b [java] Change rule priority of new rules to 3 2020-06-22 19:34:58 +02:00
Andreas Dangel 6fded20178 Merge branch 'master' into perf-UseIOStreamsWithApacheCommonsFileItem 2020-06-22 19:32:29 +02:00
Andreas Dangel 6143163b64 [doc] Multivalued rule properties are still supported for xpath 2.0. 2020-06-22 19:25:33 +02:00
Andreas DangelandClément Fournier c098936708 [core] Use DeprecatedAttribute.NO_REPLACEMENT for List attributes
Co-authored-by: Clément Fournier <clement.fournier76@gmail.com>
2020-06-22 19:18:55 +02:00
Andreas Dangel da65981619 [doc] Define rule implementation as internal API in release notes 2020-06-22 19:16:51 +02:00
Clément Fournier 99b8f4e443 Merge branch 'perf-UseStringBufferForStringAppends' 2020-06-21 17:58:18 +02:00
Clément Fournier ee8d77bf09 Merge branch 'master' into perf-UseStringBufferForStringAppends 2020-06-21 17:58:06 +02:00
Clément Fournier 75146a06bf Merge branch 'master' into perf-InefficientStringBuffering 2020-06-21 17:50:29 +02:00
Clément Fournier 469befe4d6 Merge branch 'perf-AvoidCalendarDateCreation' 2020-06-21 17:43:08 +02:00
Clément Fournier ae2b481aa2 Merge branch 'master' into perf-AvoidCalendarDateCreation 2020-06-21 17:42:25 +02:00
Andreas Dangel 9810cdd654 Fix StdCyclomaticComplexity: enums should not be considered
In Apex enums, there can't be any custom methods.
2020-06-20 19:54:54 +02:00
Andreas Dangel 5b0c20a93f [apex] Support top-level enums in rules 2020-06-20 19:49:46 +02:00
Andreas Dangel 23c08b52b2 [apex] Internalize ApexParser and ApexHandler 2020-06-20 19:28:48 +02:00
Andreas Dangel 9c48ad1523 [core] Deprecate support for List attributes with XPath 2.0
Fixes #2451
2020-06-20 14:44:21 +02:00
Andreas Dangel 2df282a260 [doc] Update release notes, fixes #971 2020-06-20 12:08:20 +02:00
Andreas Dangel d45612dde0 [plsql] Deprecate overly specific base rule classes
Refs #971
2020-06-20 12:05:15 +02:00
Andreas Dangel a19e50a804 [apex] Deprecate overly specific base rule classes
Refs #971
2020-06-20 12:01:38 +02:00
Andreas Dangel f6644c0eb0 [java] Deprecate overly specific base rule classes
Fixes #971
2020-06-20 11:54:55 +02:00
Andreas Dangel 26cfd347fd Merge branch 'master' into perf-UseStringBufferForStringAppends 2020-06-20 11:29:11 +02:00
Andreas Dangel eed1c6cab2 Merge branch 'pr-2603'
[cpp] Support unicode in identifiers #2603
2020-06-20 11:16:07 +02:00
Andreas Dangel 02195815d2 [doc] Update release notes, fixes #1757 2020-06-20 11:15:58 +02:00
Andreas Dangel 4b494899bf [java] UseStringBufferForStringAppends: fix false positives
Fix false positives with field assignment and shadowing parameters
2020-06-20 10:50:31 +02:00
Clément Fournier d624ee99f0 Add tests 2020-06-18 21:32:19 +02:00
Clément Fournier 7f081f0e63 Simplify int literals 2020-06-18 20:56:43 +02:00
Clément Fournier b56e9e6708 Fix floats 2020-06-18 20:56:42 +02:00
Clément Fournier c429a4e0c4 Fix wrong grammar for digit separators 2020-06-18 20:56:18 +02:00
Clément Fournier 673fe3934d Fix hex numbers in uppercase 2020-06-18 20:56:00 +02:00
Clément Fournier 185c172b3c c++ ident unicode support 2020-06-18 20:54:41 +02:00
Andreas Dangel 534bfe3c55 Merge branch 'pr-2572'
[cpd] Allow CPD tests based on a text dump #2572
2020-06-18 20:09:58 +02:00
Andreas Dangel 095dff1358 [doc] Update release notes, refs #2572, fixes #2483 2020-06-18 19:58:16 +02:00
Andreas Dangel a9f61260ae [scala] Remove unnecessary surefire config 2020-06-18 19:58:16 +02:00
Andreas Dangel b607fa95d0 Don't use \\R yet... 2020-06-18 19:58:12 +02:00
Clément Fournier e435037fdc Merge branch 'fix-xpath-rulechain' 2020-06-18 17:16:32 +02:00
Clément Fournier 2cfec287db Merge branch 'master' into fix-xpath-rulechain 2020-06-18 17:16:23 +02:00
Clément Fournier 121fb55567 Add test case 2020-06-18 17:12:37 +02:00
Andreas Dangel 0f06f5132a Merge branch 'pr-2593'
[java] NPathComplexity should mention the expected NPath complexity #2593
2020-06-18 15:09:35 +02:00
Andreas Dangel 186355c4f0 [doc] Update release notes, fixes #2570, refs #2593 2020-06-18 15:08:37 +02:00
Andreas Dangel fd63c97d33 [java] NPathComplexityRule: Use String.valueOf consistently 2020-06-18 15:07:00 +02:00
Andreas Dangel db89c43fb6 Merge branch 'pr-2566'
[java] Auxclasspath in PMD CLI does not support relative file path #2566
2020-06-18 15:04:49 +02:00
Andreas Dangel ca44ca3964 Merge branch 'pr-2557'
[java] UseProperClassLoader can not detect the case with method call … #2557
2020-06-18 15:03:43 +02:00
Andreas Dangel 45d3c07201 Merge branch 'pr-2556'
[apex] Exception applying rule UnusedLocalVariable on trigger #2556
2020-06-18 15:01:25 +02:00
Andreas Dangel 18c3796760 [doc] Update release notes, refs #2600, refs #1932 2020-06-18 14:50:01 +02:00
Andreas Dangel 5579ddc21a [java] UseStringBufferForStringAppends: add good example 2020-06-18 14:48:34 +02:00
Andreas Dangel dda76be8ae [java] UseStringBufferForStringAppends: fix false negative with fields
And also fix false positive when concatenation is local to each
for-loop iteration.

Test cases originally from #1932

Author: jborgers <jborgers@jpinpoint.com>
2020-06-18 14:37:47 +02:00
Andreas Dangel a7f0c3d55f [doc] Update release notes, refs #2599 2020-06-18 12:57:18 +02:00
Andreas Dangel 4e0e2d14ba [core] Fix XPath 2.0 Rule Chain Analyzer
For the XPath expression

(//ForStatement | //WhileStatement | //DoStatement)//AssignmentOperator

we threw away "AssignmentOperator" and started visiting at this node.
But that's not possible, because that's not at the root of the expr.
2020-06-18 12:44:18 +02:00
Andreas Dangel f1d46714a5 [java] InefficientStringBuffering: fix another ternary false positive 2020-06-18 12:10:36 +02:00
Andreas Dangel 4feb44b373 [java] AvoidCalendarDateCreation: fix more false positives 2020-06-18 11:58:37 +02:00
Andreas Dangel 93930c40fb Merge branch 'master' into perf-AvoidCalendarDateCreation 2020-06-18 11:13:55 +02:00
Andreas Dangel f1400e37f7 [java] AvoidCalendarDateCreation - fix false positives 2020-06-18 11:11:15 +02:00
Andreas Dangel 2ed80df735 [doc] Update release notes, refs #2591 2020-06-18 10:34:31 +02:00
Andreas Dangel 1e986ed793 [java] Fix false positive for AppendCharacterWithChar and InefficientStringBuffering
Also make both rules use the rule chain.
2020-06-18 10:28:12 +02:00
Artem Krosheninnikov 2b882e8655 fix issue #2594, update exec-maven-plugin everywhere 2020-06-18 00:48:57 +03:00
Clément Fournier 2592c56229 Make apex end column inclusive 2020-06-17 20:03:16 +02:00
Clément Fournier 8e47ed3188 Merge branch 'master' into cpd-text-comp 2020-06-17 20:00:50 +02:00
Andreas Dangel ca0f6535a4 Merge branch 'pr-2573'
[java] DefaultPackage: Allow package default JUnit 5 Test methods #2573
2020-06-15 20:26:04 +02:00
Andreas Dangel e3bed25b4b [doc] Update release notes, refs #2573 2020-06-15 20:24:46 +02:00
Clément Fournier 62c5ebe482 Merge branch 'issue-2545' 2020-06-15 17:46:11 +02:00
Clément Fournier 527b75ceb4 Merge branch 'master' into issue-2545 2020-06-15 17:42:27 +02:00
Clément Fournier 2b19527649 Change property name to be camelCase 2020-06-15 17:41:30 +02:00
Artem Krosheninnikov 5706dbc4b8 fix issue #2570, add information about expected NPath complexity to rule violation message 2020-06-14 22:42:51 +03:00
Clément Fournier d631b79307 Deprecate stuff for #2491 2020-06-14 21:36:33 +02:00
Andreas Dangel b8e9ff19b2 [java] Fix rules InefficientStringBuffering and refactor existing rules
Rules affected additionally: AppendCharacterWithChar,
ConsecutiveLiteralAppends, InsufficientStringBufferDeclaration

Deprecate InefficientStringBuffering::isInStringBufferOperation
2020-06-14 12:59:06 +02:00
Artem Krosheninnikov 1986ae65da revert jcommander as after 1.72 some methods were removed 2020-06-14 12:59:36 +03:00
Clément Fournier 87797f7621 Port JSP tests 2020-06-14 05:27:46 +02:00
Craig Andrews 18191a1814 [java] Allow package default JUnit 5 Test methods
JUnit 5 allows test methods to be default / package scoped.
2020-06-13 23:19:51 -04:00
Clément Fournier 05f3740832 Make method private 2020-06-14 02:31:28 +02:00
Clément Fournier 332e2369f5 Fix pmd warning 2020-06-14 01:22:17 +02:00
Clément Fournier 1bdbd4883c Convert groovy tests 2020-06-14 01:09:49 +02:00
Clément Fournier 59dfa15269 Fix groovy columns 2020-06-14 01:04:32 +02:00
Clément Fournier b976d6550d Preserve column numbers in AnyTokenizer 2020-06-14 00:42:15 +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
Clément Fournier 394b866524 Convert swift tests 2020-06-13 23:58:17 +02:00
Clément Fournier aedd2ce493 Convert python tests 2020-06-13 23:56:55 +02:00
Clément Fournier 2c563436e4 Convert plsql tests 2020-06-13 23:48:21 +02:00
Clément Fournier 15d6515278 Convert ObjC tests 2020-06-13 23:44:34 +02:00
Clément Fournier 60d028a282 Convert matlab tests 2020-06-13 23:39:35 +02:00
Clément Fournier 9fc15f0b91 Remove test
This is already tested in SourceCodeTest in pmd-core
2020-06-13 23:34:00 +02:00
Clément Fournier 3df4506365 Convert scala tests 2020-06-13 23:25:24 +02:00
Clément Fournier ff2aa9c038 Convert lua tests 2020-06-13 23:01:14 +02:00
Clément Fournier 7e594e390a Convert fortran tests 2020-06-13 22:57:18 +02:00
Clément Fournier 6eba9a827f Fix ruby lexer 2020-06-13 22:51:00 +02:00
Clément Fournier 50725a95fc Port ruby tests
TODO there's a bug
2020-06-13 22:08:58 +02:00
Clément Fournier da764abb1e Convert kotlin tests 2020-06-13 22:04:33 +02:00
Clément Fournier da371182aa Convert Go tests 2020-06-13 22:00:58 +02:00
Clément Fournier 4b3d58d4c9 Normalize path to avoid surprises 2020-06-13 21:52:45 +02:00
Clément Fournier 0d23c04c1b Check-in reference files 2020-06-13 21:47:49 +02:00
Clément Fournier 6ff4a1c4d4 Rename test file 2020-06-13 21:37:47 +02:00
Clément Fournier d8c3831db8 Fix getSlice
The method path for when the
code is not loaded yet was incorrect.

This was hidden by the fact that tests
use a dummy tokenizer *before* cutting
out a slice, so that the code is in the
soft reference, and that code path is
never taken in the relevant tests.
2020-06-13 21:24:36 +02:00
Clément Fournier 344d02600c Convert java tests 2020-06-13 21:09:31 +02:00
Clément Fournier 709996fddc Finish cpp module 2020-06-13 20:34:30 +02:00
Artem Krosheninnikov 6068f57e28 Update jcommander, logback-classic and snakeyaml 2020-06-13 21:23:25 +03:00
Clément Fournier 551ab453fd Convert CPP tests 2020-06-13 20:14:08 +02:00
Andreas Dangel 67cca2a123 [java] Add test cases for InefficientStringBuffering
Originally from #1932

Author: jborgers <jborgers@jpinpoint.com>
2020-06-13 20:00:51 +02:00
Andreas Dangel 488f38871e [doc] Update release notes, refs #1932 2020-06-13 19:49:12 +02:00
Andreas Dangel 9dea892121 [java] Update rule AvoidCalendarDateCreation to use XPath 2.0 2020-06-13 19:48:50 +02:00
jborgers ca6a1b6b1f Add performance rule AvoidCalendarDateCreation
Including unit tests and examples. Originating from github.com/jborgers/PMD-jPinpoint-rules.
Links to more doc later.
2020-06-13 19:39:32 +02:00
Clément Fournier 0a1e82efad Rename dir 2020-06-13 19:21:27 +02:00
Clément Fournier e48fc7cca2 Convert JS tests 2020-06-13 19:16:22 +02:00
Clément Fournier 4e21c1a947 Fix js tests 2020-06-13 19:02:35 +02:00
Andreas Dangel b8e1ec95e1 [doc] Update release notes, refs #1932 2020-06-13 18:59:23 +02:00
Andreas Dangel 8132a4af8d [java] UseIOStreamsWithApacheCommonsFileItem - Upgrade to XPath 2.0 2020-06-13 18:51:30 +02:00
Andreas Dangel 0d4ed1a2ff [java] UseIOStreamsWithApacheCommonsFileItem - improve description 2020-06-13 18:47:25 +02:00
Andreas Dangel 48583f9f58 [java] Rename new rule to UseIOStreamsWithApacheCommonsFileItem 2020-06-13 18:44:07 +02:00
jborgers bb3223d92c Add performance rule AvoidApacheCommonsFileItemNonStreaming
Including unit tests and examples. Originating from github.com/jborgers/PMD-jPinpoint-rules.
Links to more doc later.
2020-06-13 18:36:52 +02:00
Andreas Dangel bff3bcb487 Merge branch 'pr-2349'
[java] Optimize UnusedPrivateMethodRule #2349
2020-06-13 18:14:53 +02:00
Andreas Dangel bd10b778ed [doc] Update release notes, refs #2349 2020-06-13 18:14:02 +02:00
Andreas Dangel ae5fec78cd [java] UnusedPrivateMethod - improve javadoc 2020-06-13 18:12:20 +02:00
Clément Fournier 30f3d11795 Fix java test 2020-06-13 18:00:57 +02:00
Clément Fournier a976e9af47 Fix sourceCode test 2020-06-13 17:11:47 +02:00
Clément Fournier 1ee33c7c20 Normalize CPD newlines
Otherwise tests are not platform-independent.
Denormalizing to a platform-specific delimiter
should be done in the renderers
2020-06-13 16:57:57 +02:00
Clément Fournier ceda6bb965 Fix newline-only tokens
This happens eg in XML. Previously the end column would have been zero. We can't blindly make it 1 because the end column is inclusive. So we instead use the last column of the previous line.
2020-06-13 14:46:55 +03:00
Clément Fournier 6ebe4c8775 Port xml tests 2020-06-13 02:29:50 +02:00
Clément Fournier d405eab97f Fix java 7 incompatibility 2020-06-12 18:22:21 +02:00
Clément Fournier 43412b532b Fix column problem with Antlr multiline tokens 2020-06-12 18:15:33 +02:00
Clément Fournier 4b6920c16d Merge branch 'uselessoverridingmethod-false-negative' 2020-06-12 17:37:07 +02:00
Clément Fournier 6c51cec444 Merge branch 'master' into uselessoverridingmethod-false-negative 2020-06-12 17:36:38 +02:00
Clément Fournier 826bc36331 Normalize text before tokenizing
Otherwise column numbers are messed up on windows
2020-06-12 17:27:11 +02:00
Clément Fournier 1540ec6d91 Port remaining dart tests 2020-06-12 16:56:43 +02:00
Clément Fournier ecc8699269 Add doc 2020-06-12 16:27:40 +02:00
Clément Fournier b47001c90d Add text comparison tests for CPD 2020-06-12 16:01:00 +02:00
Andreas Dangel 5653400257 Merge branch 'pr-2519'
[java] Enable rule UnnecessaryCast (codestyle) #2519
2020-06-12 13:55:44 +02:00
Andreas Dangel a171ab8512 [doc] Update release notes and releases ruleset 2020-06-12 13:54:40 +02:00
Andreas Dangel 7820c17435 [java] UnnecessaryCastRule: fix false positive with maps (nested generics) 2020-06-12 13:11:24 +02:00
Andreas Dangel 28ea13e4f9 Merge branch 'pr-2567'
[c#] Fix CPD suppression with comments doesn't work #2551 #2567
2020-06-12 12:49:21 +02:00
Andreas Dangel 30ec2829bd [doc] Update release notes, fixes #2551, refs #2567 2020-06-12 12:48:31 +02:00
Andreas Dangel 702936ba45 Merge branch 'pr-2552'
[doc] Update next major development page for PMD 7 plans #2552
2020-06-12 12:45:39 +02:00
Andreas Dangel 8f606c787e Merge branch 'pr-2547'
[scala] Add cross compilation for scala 2.12 and 2.13 #2547
2020-06-12 12:44:50 +02:00
Andreas Dangel c70c150c31 Revert "travis symlink support"
This reverts commit 06e2da0653.
2020-06-12 12:44:16 +02:00
Andreas Dangel a7c824905f [doc] fix warnings while generate javadoc links
This is due to changed project structure in pmd-scala
2020-06-07 13:15:33 +02:00
Andreas Dangel d04c78035e [doc] Update release notes, refs #2547 2020-06-07 12:55:27 +02:00
Andreas Dangel 8defb2fde2 Add missing relativePath configuration in all pom modules 2020-06-07 12:36:58 +02:00
Andreas Dangel 425a45a006 [scala] Fix javadoc generation and upload
Due to the different project structure, the paths need
to be adjusted
2020-06-07 12:31:47 +02:00
Andreas Dangel d8d3aa0af7 [scala] Introduce parent pom pmd-scala-common 2020-06-07 12:24:54 +02:00
Andreas Dangel abc230c637 [scala] Refactor project structure
* Avoid using symlinks, this is very difficult to get working
  under Windows
* Provide names for the different scala modules
* Rename pmd-scala to pmd-scala-common
* Restore main module pmd-scala for backwards compatibility
2020-06-07 11:52:10 +02:00
LixonLookose e2a526461a Updated documentation #2551
Updated cpd.md with "C#" to the list of languages, that support suppression.
2020-06-05 18:32:02 +05:30
Andreas Dangel 1483918308 [core] Fix tests under Windows, fix space handling in test
Absolute paths under Windows use a drive letter...
2020-06-05 11:53:52 +02:00
LixonLookose c7c31be6cc [c#] CPD suppression with comments doesn't work #2551
CPD Suppressions for c# fixed
test added
2020-06-04 17:53:22 +05:30
Andreas Dangel 08c6ffd719 [java] Auxclasspath in PMD CLI does not support relative file path
Fixes #2549
2020-06-04 12:27:07 +02:00
Andreas Dangel 17556f8c6a [doc] Update release notes, refs #2563 2020-06-03 19:30:33 +02:00
Andreas Dangel e4368c9f7c [java] UselessOverridingMethod false negative with already public methods 2020-06-03 19:23:22 +02:00
xioayuge 230b041c28 Update LawOfDemeterRule.java 2020-05-31 19:48:58 +08:00
João Ferreira 06e2da0653 travis symlink support 2020-05-31 12:33:28 +01:00
João Ferreira 0d83b188dc fix parent 2 2020-05-31 12:11:03 +01:00
João Ferreira 050687f2d6 fix parent 2020-05-31 12:05:57 +01:00
João Ferreira f3e1f68594 fix pmd-dist 2020-05-31 11:59:46 +01:00
João Ferreira f4880f9318 refactor scala modules configuration 2020-05-31 11:59:44 +01:00
Andreas Dangel b21f3efcfd [java] UseProperClassLoader can not detect the case with method call on intermediate variable
Fixes #2544
2020-05-30 11:23:23 +02:00
Andreas Dangel c680b260b9 [apex] Exception applying rule UnusedLocalVariable on trigger
Fixes #2554
2020-05-30 11:08:44 +02:00
Andreas Dangel 7b6a70bd0f [doc] Update release notes, fixes #2545 2020-05-30 10:43:00 +02:00
Andreas Dangel cae1316472 [java] UseDiamondOperator - add property java7compatibility
This property is disabled by default, so that the rule
suggests changes that work on java8+ only by default.

Enable the version dependent tests.
2020-05-30 10:38:09 +02:00
Andreas Dangel c2cea9d15b [java] UseDiamondOperator - support nested type arguments
Fixes #2545 partially
2020-05-30 10:23:52 +02:00
Andreas Dangel bc4a1d67eb Update gems 2020-05-29 09:27:58 +02:00
Andreas Dangel 3f69a8a56c [doc] Update deprecated rules list 2020-05-29 09:01:21 +02:00
Andreas Dangel e4e86195be [doc] Update next major development page for PMD 7 plans 2020-05-29 08:50:54 +02:00
João Ferreira 867f8b2adf fix project name 2020-05-27 20:41:18 +01:00
João Ferreira 9c632dcd83 Cross compile pmd-scala module 2020-05-27 15:40:53 +01:00
Andreas Dangel 70ac66dcb2 Fix rule tag 2020-05-24 19:17:53 +02:00
Andreas Dangel 8c1105f4cd Clearify release step 2020-05-24 18:14:55 +02:00
Andreas Dangel 10220fb9a7 [doc] Update deprecated rules 2020-05-24 18:14:23 +02:00
Andreas Dangel e5a5fa9642 Prepare next development version 2020-05-24 17:35:24 +02:00
Andreas Dangel ab04bdacdd [maven-release-plugin] prepare for next development iteration 2020-05-24 17:34:34 +02:00
Andreas Dangel 229cb2bdca [maven-release-plugin] prepare release pmd_releases/6.24.0 2020-05-24 17:34:25 +02:00
Andreas Dangel f2b8d21d41 Prepare pmd release 6.24.0 2020-05-24 17:22:57 +02:00
Andreas Dangel 7feb805f96 [java] UnnecessaryCastRule: verify clone is not flagged 2020-05-23 18:41:37 +02:00
Andreas Dangel 473a806cb7 [java] UnnecessaryCastRule: Avoid cast false-positives 2020-05-23 18:38:14 +02:00
Andreas Dangel ff33cf0081 Update pmd-designer to 6.24.0 2020-05-23 17:45:48 +02:00
Andreas Dangel a3a292d591 Remove unnecessary source-type tags in rule tests
source-type is actually only needed if
* the language supports more than one version
* the parser behaves differently with different versions
  (this has to do with compatibility, e.g. assert/enum keywords
  in java)
* the test needs a newer version than the default version
  (e.g. to test new language features)
* the test needs an older version than the default version
  (e.g. the rule has a maximumLanguageVersion specified)
* the rule behaves differently for different versions
  (e.g. BigIntegerInstantiation)
2020-05-23 14:16:13 +02:00
Andreas Dangel 561825703f [doc] Fix rule tags in the rule docs
If using quotes, there was a html escape done, which made
the rule tag renderer to spit out "quot".
2020-05-23 13:07:25 +02:00
Andreas Dangel 6edd6c3ebb [doc] Update gems 2020-05-23 11:01:11 +02:00
Andreas Dangel bc7328fded [doc] Support nested classes when generating jdoc links
Only one level of nesting is supported.
This fixes the link to AntlrTokenManager.ANTLRSyntaxError
2020-05-23 10:59:48 +02:00
Andreas Dangel d21e309043 [java] AvoidPrintStackTrace - fix tests and deprecation warning 2020-05-22 20:19:45 +02:00
Andreas Dangel 4899d04cb3 Merge branch 'pr-2522'
[java] AvoidPrintStackTrace - consider method calls #2522
2020-05-22 20:15:41 +02:00
Andreas Dangel db88d03879 [doc] Update release notes, fixes #2437 2020-05-22 20:12:03 +02:00
Andreas Dangel 9936cc34b4 Merge branch 'pr-2495'
[c#] Support for interpolated verbatim strings #2495
2020-05-22 19:53:10 +02:00
Andreas Dangel 2e60a60838 [doc] Update release notes, refs #2495 2020-05-22 19:52:24 +02:00
Andreas Dangel aafd39b1fd Merge branch 'pr-2493'
[java] Deprecate redundant String Comparison rules #2493
2020-05-22 19:50:20 +02:00
Andreas Dangel b49279d475 [doc] Update release notes, refs #2493, fixes #2145 2020-05-22 19:49:02 +02:00
Andreas Dangel 90903f076b [java] Document deprecations in code for PositionLiterals*Rule 2020-05-22 19:48:46 +02:00
Andreas Dangel e1cd3b4c8d Merge branch 'pr-2487'
[all] Cleanup rule test xml #2487
2020-05-22 19:41:01 +02:00
Andreas Dangel e9ce6590af [doc] Clarify source-type for rule tests 2020-05-22 19:38:57 +02:00
Andreas Dangel bf16b508f7 Merge branch 'pr-2476'
[java] MethodNamingConventions - Add support for JUnit 5 method naming #2476
2020-05-22 19:30:41 +02:00
Andreas Dangel d0eb3292ba [doc] Update release notes, refs #2476 2020-05-22 19:29:39 +02:00
Andreas Dangel aa1722e9e3 [java] Fix TypeHelper if the searched type is not fully qualified 2020-05-22 18:58:59 +02:00
Andreas Dangel 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
Andreas Dangel 6049126228 Merge branch 'pr-2465'
[dependencies] Upgrade hamcrest, mockito and JUnit #2465
2020-05-22 11:46:04 +02:00
Andreas Dangel 9378c1abb8 [doc] Update release notes, refs #2465 2020-05-22 11:44:18 +02:00
Andreas Dangel 11f413e6ee Add missing dependency junit or scope test 2020-05-22 11:37:22 +02:00
Andreas Dangel 5f3ff0aed8 Remove hamcrest dependency, where it is not needed directly.
Use scope compile for hamcrest in pmd-lang-test
2020-05-22 11:36:49 +02:00
Andreas Dangel cb910d69c7 Merge branch 'pr-2444'
[core] Support reproducible builds #2444
2020-05-22 11:03:05 +02:00
Andreas Dangel 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
Maikel Steneker 9c2deba035 Add support for C# 8 interpolated verbatim strings that start with @$. 2020-05-19 16:49:19 +02:00
John Teng 261f2d747a removed unintentional keypress 2020-05-18 16:58:13 -04:00
John Teng 01c283ce00 Added deprecated tags to code and bestpractices ruleset, updated quickstart ruleset 2020-05-18 16:56:12 -04:00
Clément Fournier cd5333e236 Fix dead link in CONTRIBUTING.md 2020-05-18 21:16:04 +02:00
Andreas Dangel 0cc00277d3 Merge branch 'pr-2474'
[core] Stop JavaCharStream from throwing Error #2474
2020-05-18 20:28:37 +02:00
Andreas Dangel ca341e85d4 [doc] Update release notes, fixes #2472 2020-05-18 20:27:03 +02:00
Andreas Dangel 2b4d05e127 Merge branch 'pr-2475'
[swift] Swift 4.2-5.2 support #2475
2020-05-18 20:23:10 +02:00
Andreas Dangel fe98d8a15a [doc] Update release notes, fixes #2473, refs #2475 2020-05-18 20:22:18 +02:00
Andreas Dangel 3449c9a372 Merge branch 'pr-2478'
[java] New rule: LiteralsFirstInComparisons #2478
2020-05-18 20:17:23 +02:00
Andreas Dangel 526526be47 [java] Reformat (whitespaces) LiteralsFirstInComparisons.xml 2020-05-18 20:16:41 +02:00
Andreas Dangel 7138d2e4d4 [doc] Update release notes, refs #2478 2020-05-18 20:11:45 +02:00
Andreas Dangel 3305eeedd2 [core] Add new rule to releases ruleset for 6.24.0 2020-05-18 20:11:25 +02:00
Andreas Dangel 0fa0c4a70c [java] add new rule in quickstart.xml 2020-05-18 20:11:04 +02:00
Andreas Dangel 979d81c02e Merge branch 'pr-2481'
[java] Fix JUnitSpellingRule false positive #2481
2020-05-18 19:57:45 +02:00
Andreas Dangel 33e3bc24c4 [doc] Update release notes, fixes #2477, refs #2481 2020-05-18 19:57:05 +02:00
Andreas Dangel dfd5e608d6 [java] Remove unnecessary CDATA in JUnitSpelling.xml 2020-05-18 19:55:39 +02:00
Artem Krosheninnikov ad68cdda24 Fix review remarks 2020-05-16 23:26:24 +03:00
Clément Fournier 382a1a15f6 Merge branch 'improve-alias-api' 2020-05-16 19:22:10 +02:00
Clément Fournier 35e9f7d1bd Doc 2020-05-16 19:19:48 +02:00
Clément Fournier c5f73d137a Add test for invalid language version NPE
Refs https://github.com/pmd/pmd/pull/2486#discussion_r425381773
2020-05-16 19:07:09 +02:00
Clément Fournier e1a22282d0 Merge branch 'master' into improve-alias-api 2020-05-16 18:56:54 +02:00
Andreas Dangel 09a30d2ef5 [doc] Fix indentation in rule testing doc, add note about CDATA 2020-05-16 18:56:05 +02:00
Andreas Dangel 7de968a5c9 [jsp] Cleanup rule test xml files
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
Andreas Dangel 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
Andreas Dangel b3215c830d [xml] Cleanup rule test xml files
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
Andreas Dangel fef1ad76c6 [vm] Cleanup rule test xml files
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
Andreas Dangel 7334738a97 [plsql] Cleanup rule test xml files
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
Andreas Dangel 48da3feee0 [modelica] Cleanup rule test xml files
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
Andreas Dangel edc40521a3 [visualforce] Cleanup rule test xml files
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
Andreas Dangel 4c2c111492 [javascript] Cleanup rule test xml files
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
Andreas Dangel 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
Andreas Dangel 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
Andreas Dangel 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
Andreas Dangel 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
Andreas Dangel 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
Andreas Dangel 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
Andreas Dangel 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
Andreas Dangel 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
Andreas Dangel f930491538 [apex] Cleanup rule test xml files
Avoid unnecessary CDATA for description
Use 4 space indentation instead of tabs
Remove trailing whitespace
End file with a newline
2020-05-16 18:55:58 +02:00
Juan Martín Sotuyo Dodero 465dead81c Optimize imports 2020-05-15 11:44:09 -03:00
John Teng 72128e1476 fixed the rule version, removed CDATA tags from descriptions 2020-05-15 10:43:51 -04:00
Juan Martín Sotuyo Dodero 0f552ee620 Further refine the addVersion API 2020-05-15 11:42:28 -03:00
Juan Martín Sotuyo Dodero d1e0f8c5fa Bring back binary compatibility 2020-05-14 16:30:06 -03:00
Juan Martín Sotuyo Dodero 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
Andreas Dangel 0196ca7a0c Merge branch 'pr-2479'
[java] False positive with Hamcrest's assertThat #2479
2020-05-14 20:36:02 +02:00
Andreas Dangel a9dda0336d [doc] Update release notes, fixes #2288, refs #2479 2020-05-14 20:30:29 +02:00
Andreas Dangel 8fce3a300f [java] Small refactoring for JUnitTestsShouldIncludeAssertRule 2020-05-14 20:30:24 +02:00
Andreas Dangel 27b2b881d7 Merge branch 'pr-2485'
[core] Require Java 11 #2485
2020-05-14 19:59:28 +02:00
Andreas Dangel c739b9c14f [doc] Update release notes, fixes #2484, refs #2485 2020-05-14 19:59:18 +02:00
Andreas Dangel 9fd1dc9ca2 [doc] Update build instructions to require java 11 from now on 2020-05-14 19:58:08 +02:00
Juan Martín Sotuyo Dodero 900768ace5 Require Java 11 2020-05-14 12:28:25 -03:00
kenji e8f9d939e2 Swift 4.2-5.2 support 2020-05-14 10:24:47 +02:00
Clément Fournier a12d13a1ac Merge branch 'javascript-ast-tests' 2020-05-13 16:06:49 +02:00
Clément Fournier ccd851dc9c Merge branch 'master' into javascript-ast-tests 2020-05-13 16:06:24 +02:00
Artem Krosheninnikov 8b5be784fd fix pmd violation 2020-05-13 02:05:27 +03:00
Artem Krosheninnikov d349d66696 fix JUnitSpellingRule false positive, closes #2477. Also add two more tests 2020-05-13 01:46:36 +03:00
andreoss 1f0d7ae620 [java] False positive with Hamcrest's assertThat
Fixes #2288
2020-05-12 17:51:54 -04:00
John Teng 99db8b4373 Added new rule to bestpractices category, added unit tests for all comparison cases 2020-05-12 17:07:21 -04:00
John Teng 8ff452080b Added new rule corresponding to all string literal comparisons 2020-05-12 17:06:08 -04:00
Artem Krosheninnikov 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
Ritz, Bruno a0e2558ca2 Add a test case for the JUnit 5 naming rules 2020-05-11 11:53:53 +02:00
Ritz, Bruno 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
Andreas Dangel 2bce93c8b6 Merge branch 'pr-2457'
[xml] Adding XML to CPD supported languages #2457
2020-05-08 10:56:52 +02:00
Andreas Dangel 8d87b9fd70 [doc] Update release notes, refs #2457 2020-05-08 10:55:55 +02:00
Andreas Dangel 9eba0a03c3 [core] AntlrTokenizer.getCharStreamFromSourceCode is now public 2020-05-08 10:55:35 +02:00
Andreas Dangel b740225079 [doc] Update release notes, refs #2469, fixes #2468 2020-05-08 10:30:31 +02:00
Robert Sösemann c48e25da9e Merge pull request #2469 from gwilymatgearset/apex/fix-false-positive-with-method-called
[apex] fix false positive unused variable if only a method is called
2020-05-07 21:11:22 +02:00
Clément Fournier c457f09f08 Update release notes 2020-05-07 18:19:50 +02:00
Clément Fournier bf027382f5 Test 2020-05-07 18:14:42 +02:00
Clément Fournier eeed02ab86 Fix tests 2020-05-07 18:01:41 +02:00
Clément Fournier f8b8c229f8 Make JavaCharStream not throw Error 2020-05-07 17:59:00 +02:00
Clément Fournier 551620bbad Checkout TokenMgrError from 7.0.x, make binary compatible with master 2020-05-07 17:59:00 +02:00
Fernando Cosso 4f96286902 Implementing changes from the discussion 2020-05-07 11:49:52 -04:00
Andreas Dangel 35b559bb1e [doc] Add info about reproducible builds 2020-05-07 10:09:58 +02:00
Gwilym Kuiper 3571608234 Handle chained method calls.
This wasn't working because they had a null image. Turns out that nodes
have a method called `hasImageEqualTo` which handles the null case for
us.
2020-05-06 11:26:14 +01:00
Gwilym Kuiper acbf53e8ab Variable is used if method is called on it 2020-05-06 11:11:13 +01:00
Artem Krosheninnikov 3fba3f6217 Update hamcrest to 2.2, Junit to 4.13, mockito to 2.28.2 2020-05-04 23:00:28 +03:00
Fernando Cosso a2cd3fd8e5 Removed tab character in pom.xml 2020-04-30 16:38:03 -04:00
Fernando Cosso 3a3b0a0908 Adding antlr4 to pom, tests 2020-04-30 15:16:31 -04:00
Andreas Dangel 4d2749b697 Merge branch 'pr-2452'
[doc] Fix "Making Rulesets" doc sample code indentation #2452
2020-04-30 19:42:13 +02:00
Andreas Dangel f636c1fe8c [doc] Update release notes, refs #2452 2020-04-30 19:41:39 +02:00
Andreas Dangel 522e98b65f Merge branch 'pr-2446'
[core] Update maven-compiler-plugin to 3.8.1 #2446
2020-04-30 19:29:38 +02:00
Andreas Dangel fdabf7e25d [doc] Update release notes, refs #2446 2020-04-30 19:28:35 +02:00
Fernando Cosso 15da8cb16a Adding XML to CPD 2020-04-30 13:06:52 -04:00
Andreas Dangel 01c5900e7e Merge branch 'pr-2449'
[plsql] Additional info in SqlStatement, FormalParameter and FetchStatement #2449
2020-04-30 18:55:44 +02:00
Andreas Dangel 6c97fb093b [doc] Update release notes, refs #2449 2020-04-30 18:54:36 +02:00
Andreas Dangel ad8662ccc4 [plsql] Add more tests 2020-04-30 18:52:21 +02:00
Andreas Dangel ef9d5fd89d [plsql] Small improvements, see #2449 2020-04-30 18:24:59 +02:00
Clément Fournier 0adb7c8635 Add some DeprecatedAttribute annotations
This improves warnings for XPath rules
2020-04-28 08:23:27 +02:00
Artur Dryomov e34beeb1e6 Fix "Making Rulesets" doc sample code indentation 2020-04-27 22:28:31 +03:00
Clément Fournier b88a8b2fcf Merge branch 'harsh-kukreja-master' 2020-04-27 21:25:30 +02:00
Clément Fournier 9416a8fa65 Update release notes, refs #2448 2020-04-27 21:25:23 +02:00
Andreas Dangel 4192f04c1d [apex] clarify AvoidGlobalModifier, refs #2298 2020-04-27 19:41:33 +02:00
zgrzyt93 5b8a9fabe1 Update ASTFormalParameter.java
Code style refactoring
2020-04-27 16:26:40 +02:00
zgrzyt93 944752da3f Update ASTFetchStatement.java
InternalApi annotation added.
2020-04-27 15:38:19 +02:00
zgrzyt93 08a430ed3f Update ASTSqlStatement.java
InternalApi annotation added
2020-04-27 15:32:31 +02:00
zgrzyt93 ffd573e1b5 Merge branch 'master' into additional_info 2020-04-27 15:05:22 +02:00
Grzegorz Sudolski 15b0bda348 [plsql] added some additional info in userData 2020-04-27 11:24:03 +02:00
Harsh Kukreja b2dc358aba Operator Wrap check 2020-04-27 09:09:07 +05:30
Artem Krosheninnikov 3a72f3c4fa update maven-compiler-plugin to 3.8.1 and remove workaround for a bug in IDEA that was closed 2020-04-26 14:27:37 +03:00
Andreas Dangel 9c45d90a14 [doc] Extend documentation for writing AST regression tests 2020-04-25 18:58:02 +02:00
Andreas Dangel 5f7410b499 [doc] Remove unused images 2020-04-25 18:09:02 +02:00
Andreas Dangel 01a3ae5a19 [javascript] Add a treedump test 2020-04-25 18:07:48 +02:00
Andreas Dangel 09b0e740af [doc] Update release notes, refs #2444 2020-04-25 12:10:38 +02:00
Andreas Dangel 805d06a690 Update gems 2020-04-25 11:45:13 +02:00
Andreas Dangel 556596cd48 Use pmd-designer 6.24.0-SNAPSHOT 2020-04-25 10:56:38 +02:00
Andreas Dangel 6249b4e2f2 Support reproducible builds
See https://reproducible-builds.org/ and
https://maven.apache.org/guides/mini/guide-reproducible-builds.html

The property "project.build.outputTimestamp" is supposed to be updated
automatically by maven-release-plugin when updating the version
(goal prepare).
2020-04-25 10:37:54 +02:00
Andreas Dangel 927745ae9c [ci] Skip regression-tester baseline creation on java-grammar branch
It takes too long, probably because the java rules are not updated
yet to the new java AST and therefore throwing lots of exceptions.
2020-04-25 09:33:37 +02:00
Andreas Dangel 90f590d5f1 Update pmdtester to latest stable version 2020-04-25 09:32:38 +02:00
Clément Fournier a88440bea9 Fix #2437 2020-04-24 16:44:52 +02:00
Andreas Dangel a82ceb5c4b Update PMD to 6.23.0 2020-04-24 12:49:04 +02:00
Andreas Dangel 91bd0aa446 release script - need to remove SNAPSHOT from version during release 2020-04-24 12:24:47 +02:00
Andreas Dangel 2f64a0624a Prepare next development version 2020-04-24 10:54:00 +02:00
Andreas Dangel 4308c545e5 [maven-release-plugin] prepare for next development iteration 2020-04-24 10:53:12 +02:00
Andreas Dangel 921c65f5ab [maven-release-plugin] prepare release pmd_releases/6.23.0 2020-04-24 10:53:00 +02:00
Andreas Dangel 96d542c00d Prepare pmd release 6.23.0 2020-04-24 10:42:57 +02:00
Andreas Dangel 7f154e10ac [doc] Exclude and remove unnecessary files 2020-04-24 09:54:45 +02:00
Andreas Dangel baef99df85 [doc] Update gems 2020-04-24 09:48:55 +02:00
Andreas Dangel 0e40a06161 Merge branch 'pr-2432'
[core] Close ZIP data sources even if a runtime exception or error is thrown #2432
2020-04-24 09:27:30 +02:00
Andreas Dangel eb687327c0 [doc] Update release notes, closes #2432 2020-04-24 09:27:20 +02:00
gibarsin a82e8e462d Close data sources even if a runtime exception or error is thrown in processFiles 2020-04-24 09:19:05 +02:00
Andreas Dangel cf8aa3b767 Merge branch 'pr-2434'
[core] Deprecate a few more methods in Node, AbstractNode #2434
2020-04-24 09:04:27 +02:00
Andreas Dangel 292ad4ab7b [core] More explicit deprecations on AbstractNode 2020-04-24 09:04:07 +02:00
Andreas Dangel e2e5715321 Add a verify step in do-release.sh 2020-04-24 08:41:28 +02:00
Clément Fournier 70f4d50e27 Checkstyle 2020-04-23 19:54:32 +02:00
Clément Fournier bc31cf3fd0 Update release notes 2020-04-23 19:44:21 +02:00
Clément Fournier 38f15056bb Add a line of doc 2020-04-23 19:41:35 +02:00
Clément Fournier 8fd181b29f Deprecate a few more Node methods 2020-04-23 19:41:35 +02:00
Clément Fournier 96e9127eae Cleanup TooManyFieldsRule
It used a descendant check unnecessarily,
can use the rulechain now
2020-04-23 19:33:55 +02:00
Andreas Dangel b7c1ca9c35 Fix link in release notes 2020-04-23 11:34:09 +02:00
Andreas Dangel 53f6633b4f Merge branch 'pr-2417'
[core] Host own javadoc on docs.pmd-code.org #2417
2020-04-23 11:15:44 +02:00
Andreas Dangel 71884c5157 Merge branch 'pr-2414'
[core] Fix HTMLRenderer not using linkPrefix/linePrefix #2414
2020-04-23 11:13:35 +02:00
Andreas Dangel ca75d9492d [core] Add test case with empty line prefix for HtmlRenderer 2020-04-23 11:13:18 +02:00
Andreas Dangel 51f22c1486 Merge branch 'pr-2404'
[core] Add JsonRenderer #2404
2020-04-23 11:10:15 +02:00
Andreas Dangel a0f127905b [core] CodeClimate renderer links are dead
Fixes #2426
2020-04-23 10:44:55 +02:00
Andreas Dangel bc49a8afff [javascript] Internalize AbstractInfixEcmascriptNode 2020-04-23 10:17:20 +02:00
Clément Fournier 80df45b2e5 Merge branch 'javascript-es6' 2020-04-20 11:52:31 +02:00
Clément Fournier 75d5626c40 Merge branch 'master' into javascript-es6 2020-04-20 11:51:51 +02:00
Clément Fournier 6127add18e Fix forgotten ctor in js module 2020-04-20 11:27:16 +02:00
Clément Fournier 7546d148a1 Merge branch 'scala-deprecate-ast' 2020-04-20 11:06:23 +02:00
Clément Fournier e7481a5dec Merge branch 'master' into scala-deprecate-ast 2020-04-20 11:05:42 +02:00
Clément Fournier aad67c501d Merge branch 'master' into js-deprecate-ast 2020-04-20 11:02:27 +02:00
Clément Fournier 99341599d5 Merge branch 'apex-deprecate-ast' 2020-04-20 10:56:55 +02:00
Clément Fournier f7fc5c5687 Merge branch 'master' into apex-deprecate-ast 2020-04-20 10:56:40 +02:00
Clément Fournier 8b83f3696b Merge branch 'code-of-conduct' 2020-04-20 10:55:29 +02:00
Clément Fournier beb805cb95 Merge branch 'master' into code-of-conduct 2020-04-20 10:55:16 +02:00
Clément Fournier daf84fb2bc Fix todo in release notes 2020-04-20 10:51:50 +02:00
Clément Fournier 33fd5d0ba2 Add documentation 2020-04-20 10:48:43 +02:00
Clément Fournier f22fa24cb9 Merge branch 'master' into json-report-format 2020-04-20 10:35:30 +02:00
Clément Fournier c7fce361a5 Test when linePrefix is not set 2020-04-20 10:30:45 +02:00
Clément Fournier 1572602de9 Clarify doc 2020-04-20 10:26:11 +02:00
Clément Fournier 9115d79a00 Merge branch 'master' into issue-2412 2020-04-20 10:10:47 +02:00
Clément Fournier 491e513775 Merge branch 'doc-renderer' 2020-04-20 09:46:57 +02:00
Clément Fournier 6f07a2878c Update release notes
Refs #2413
2020-04-20 09:46:11 +02:00
Clément Fournier 57ae752756 Add separate format version 2020-04-20 09:26:55 +02:00
Clément Fournier 5abaa7489a Update release notes (add todo)
Closes #1286, refs #2404, #2413
2020-04-20 09:14:04 +02:00
Clément Fournier d3c4d4b1fd Merge branch 'master' into json-report-format 2020-04-20 09:09:51 +02:00
Andreas Dangel aee04b4c68 [java] Fix more deprecated attribute usages 2020-04-18 19:06:29 +02:00
Andreas Dangel 3097e7ed02 Merge branch 'pr-2425'
[core] XPath warnings for deprecated attributes #2425
2020-04-18 18:31:36 +02:00
Andreas Dangel b1496df145 Merge branch 'xpath-warnings' of github.com:oowekyala/pmd into pr-2425 2020-04-18 18:30:59 +02:00
Andreas Dangel 5cad2ff741 [doc] Update release notes, refs #2425, fixes #2019 2020-04-18 18:22:07 +02:00
Andreas Dangel bcae7e5243 Small corrections 2020-04-18 18:20:27 +02:00
Andreas Dangel 4a9aa1a926 [core] Log deprecated attribute usage in findChildNodesWithXPath queries 2020-04-18 17:43:18 +02:00
Clément Fournier 400ca5dca5 Delete test for findChildNodesWithXPath 2020-04-18 17:42:56 +02:00
Clément Fournier e9cc7e00ef Merge branch 'master' into xpath-warnings 2020-04-18 17:36:44 +02:00
Andreas Dangel c62041e827 Merge branch 'pr-2377'
[all] Update all XPath rules to XPath 2.0 #2377
2020-04-18 11:49:44 +02:00
Andreas Dangel 054b3acf67 [doc] Update release notes, fixes #2398 2020-04-18 11:49:37 +02:00
Andreas Dangel 2da636305e Update pull request template 2020-04-18 10:34:21 +02:00
Andreas Dangel 815c87bd17 Add simple stats for releases 2020-04-18 10:28:37 +02:00
Andreas Dangel 12135cbd51 [scala] Internalize AST constructors 2020-04-18 09:22:38 +02:00
Clément Fournier 4db656a679 Cleanup 2020-04-18 01:58:02 +02:00
Clément Fournier ff8e19e794 Merge branch 'harsh-kukreja-master' 2020-04-18 01:53:59 +02:00
Clément Fournier 9caadee764 Update release notes, refs #2423 2020-04-18 01:53:44 +02:00
Harsh Kukreja 9c98508fec Operator Wrap Issue Solved 2020-04-18 05:21:35 +05:30
Clément Fournier be19da5a07 Test in pmd-core 2020-04-17 20:53:19 +02:00
Andreas Dangel 623ba4c92e [javascript] Internalize AST constructors 2020-04-17 20:44:54 +02:00
Clément Fournier 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
Clément Fournier f3db39641a Test with ASTVariableDeclaratorId#getName 2020-04-17 20:28:00 +02:00
Clément Fournier be152e92a8 Output replacement as well 2020-04-17 20:18:32 +02:00
Andreas Dangel 56ab75bfd1 [apex] Refactor usage of internal getNode()
This exposes more information directly on PMD's AST node
rather then giving away the inner jorje node.
2020-04-17 20:10:37 +02:00
Clément Fournier 9dca569cc4 Make deprecation warnings for xpath rules mention the name of the rule
Fix #2019
2020-04-17 20:04:27 +02:00
Clément Fournier 48294ae668 Cleanup 2020-04-17 20:03:39 +02:00
Clément Fournier 798cce1666 Dont use global tree cache 2020-04-17 19:59:42 +02:00
Andreas Dangel 74200132e3 [apex] Internalize AST constructors and helper implementations 2020-04-17 18:44:18 +02:00
Clément Fournier 7a37be55db Revert "don't use global namepool to avoid resource contention"
Actually benchmarking with different levels of
parallelism shows that there is no contention,
and that sharing the namepool is beneficial even
with many threads. When the number of threads is
very high, using independent namepools increases
the amount of work to allocate names.

This reverts commit 2253f38ccb.
2020-04-17 18:03:57 +02:00
Andreas Dangel 97f0a8e866 Mention code of conduct in CONTRIBUTING.md 2020-04-17 18:02:34 +02:00
Clément Fournier 2253f38ccb don't use global namepool to avoid resource contention 2020-04-17 17:10:16 +02:00
Andreas Dangel 1d4884d954 Merge branch 'pr-2419'
[javascript] Fix issue with Rhino localization and trailing commas #2419
2020-04-17 16:33:19 +02:00
Andreas Dangel 83bf4ceefc [doc] Update release notes, fixes #384, refs #2419 2020-04-17 16:33:11 +02:00
Clément Fournier 9629cacddd Checstyle 2020-04-17 16:30:37 +02:00
Andreas Dangel 83de15cc1e Update release notes 2020-04-17 16:23:43 +02:00
Clément Fournier c409809672 Merge branch 'xpath-update-rules' of github.com:oowekyala/pmd into xpath-update-rules 2020-04-17 16:20:27 +02:00
Andreas Dangel 3eb36712fd Add code of conduct
Fixes #2357
2020-04-17 16:13:34 +02:00
Andreas Dangel de875c955a [java] Convert JUnitStaticSuite to Java rule 2020-04-17 15:21:58 +02:00
Andreas Dangel c8bdc4fade [java] UseCorrectExceptionLogging - fix problem with multiple loggers 2020-04-17 14:53:26 +02:00
Andreas Dangel 80a40c00ef [java] Convert AbstractClassWithoutAbstractMethod to Java rule 2020-04-17 12:01:27 +02:00
Andreas Dangel 797a965c4b [java] Convert JUnitSpelling to Java rule 2020-04-17 11:51:06 +02:00
Andreas Dangel e81fee9ee5 [java] Convert PositionLiteralsFirstIn*Comparisons to Java rules 2020-04-17 11:24:23 +02:00
Clément Fournier dde5b29da8 Optimise attribute fetch
Use a map to fetch the
attribute, also don't recreate
attribute nodes so much, so that
the cache behind Method::invoke
in Attribute amounts to something.
2020-04-17 04:57:45 +02:00
Clément Fournier 12e843cb47 Pool names, optimize getNodeKind
NameTest::matches is a very hot spot
in saxon. Profiling shows that most
of its runtime is spent doing virtual
method dispatch on NodeInfo#getNodeKind

We optimise this by making a base class
with the node kind as a field.

Also, we now pool xpath names using saxon's
name pool, which reduces name tests to
integer comparison instead of string.equals

Saxon now spends 80x less time in the name test
overall shaving off 30% of execution time of
XPath rules.
2020-04-17 04:57:08 +02:00
Andreas Dangel 319fe80d85 [java] Simplify AvoidDecimalLiteralsInBigDecimalConstructor with type res 2020-04-16 18:57:36 +02:00
Andreas Dangel feee0b8f91 [java] Replace XPath ProperCloneImplementation with Java Rule 2020-04-16 18:57:10 +02:00
Clément Fournier fa7b286d31 Checkstyle 2020-04-16 18:17:33 +02:00
Clément Fournier c7172fe78f Add tests 2020-04-16 18:02:18 +02:00
Andreas Dangel 08d31c62a9 Merge branch 'master' into pr-2377 2020-04-16 17:52:03 +02:00
Clément Fournier 04b5372f23 Fix issue with Rhino localization 2020-04-16 17:19:04 +02:00
Andreas Dangel e2ee78dae3 [javascript] Add support for ES6 version and use that as default
Fixes #1235
Fixes #2379
2020-04-16 16:42:16 +02:00
Clément Fournier ea532e6d2d Rename RecordDeclaration::getComponentList to getRecordComponents
This name is clearer when seen from the
interface ASTAnyTypeDeclaration, also
it matches the Class API
2020-04-16 14:28:59 +02:00
Andreas Dangel 954bfb28d4 [ci] Update java to 11.0.7+10 2020-04-15 19:37:19 +02:00
Andreas Dangel f1410752bc [ci] Fixed style for pmd-lang-test 2020-04-14 17:51:21 +02:00
Andreas Dangel 92466ebd28 [doc] Use new javadoc location from https://docs.pmd-code.org
Note: the version now needs SNAPSHOT, so that the javadoc links
work on master. This is not available, if javadoc.io is used.
2020-04-14 17:40:29 +02:00
Andreas Dangel 727c398326 [ci] Upload docs and javadocs to https://docs.pmd-code.org 2020-04-14 17:19:13 +02:00
Andreas Dangel 61321c88f1 javadoc: add pmd-lang-test 2020-04-14 16:02:49 +02:00
Andreas Dangel ae958fba7b javadoc: exclude *.internal packages 2020-04-14 16:02:49 +02:00
Andreas Dangel 93ededa5c4 javadoc: add offline links between the modules and pmd-core and pmd-test 2020-04-14 16:02:49 +02:00
Andreas Dangel 545218a0c6 javadoc: Upgrade javadoc plugin 2020-04-14 16:02:45 +02:00
Andreas Dangel ac21dc95b1 Merge branch 'pr-2407'
[core] Deprecate Jaxen and XPath internal API #2407
2020-04-13 12:17:58 +02:00
Andreas Dangel 161af4dfd3 [doc] Update release notes with deprecations, see #2407 2020-04-13 12:17:13 +02:00
Andreas Dangel 5c31d40ec2 [core] XPathRule: use == for enum comparison 2020-04-13 12:16:55 +02:00
Andreas Dangel 0726496726 Merge branch 'pr-2409'
[java] ClassNamingConventions suggests to add Util for class containing only static constants, fixes #1164 #2409
2020-04-13 12:06:01 +02:00
Andreas Dangel cc2894eaf4 [doc] Update release notes, refs #2409, fixes #1164 2020-04-13 12:04:56 +02:00
Clément Fournier e70568ff54 Merge branch 'pr-2411' 2020-04-11 21:50:14 +02:00
Clément Fournier 363f70b481 Update release notes, refs #2411 2020-04-11 21:49:43 +02:00
Andreas Dangel a007b0b0cc Fix dead links 2020-04-11 21:22:35 +02:00
Andreas Dangel ad1e196173 [core] CodeClimateRenderer: correct links to spec 2020-04-11 20:18:12 +02:00
Andreas Dangel 44e43d6186 [core] Fix HTMLRenderer not using linkPrefix/linePrefix
* add new option "htmlExtension", so that the mechanism can
be used with github as well
* render links for suppressed violations and errors

Fixes #2412
2020-04-11 20:15:04 +02:00
Andreas Dangel 97f35f60d4 [doc] Fix doc for IDEA tool integration (refs #2117) 2020-04-11 19:48:48 +02:00
Andreas Dangel 9fd9ebe4a9 [doc] Add PMD report format page 2020-04-11 19:48:25 +02:00
Andreas Dangel 17c6e30c28 [doc] Add CPD report formats 2020-04-11 16:18:25 +02:00
Andreas Dangel 85924b5ad1 Merge branch 'pr-2388'
[lang-test] Use tree dumps for regression tests #2388
2020-04-11 15:09:42 +02:00
Blightbuster 8c2edd625f Fix UseAssertEqualsInsteadOfAssertTrue Example
String used ? instead of "
2020-04-11 14:32:43 +02:00
Andreas Dangel 0710877d05 [core] Deprecate AntlrToken#getType() in favor of #getKind()
Refs #2371
2020-04-10 18:50:58 +02:00
Binu R J f4b95a3ae3 [java] ClassNamingConventions suggests to add Util for class containing only static constants, fixes #1164 2020-04-09 19:15:39 +05:30
Clément Fournier 60d443963c Call default ctor
Defines properties
2020-04-09 15:28:20 +02:00
Clément Fournier 60087590e6 Remove changes to XPathHandler 2020-04-08 22:07:26 +02:00
Clément Fournier 1de1d1c66d Update some usages early 2020-04-08 22:00:36 +02:00
Clément Fournier 5067c79eb2 Cleanup a test 2020-04-08 21:38:10 +02:00
Clément Fournier 961e78954a Update some tests 2020-04-08 21:35:34 +02:00
Clément Fournier 8284fc8e81 Deprecate two other things 2020-04-08 21:35:34 +02:00
Clément Fournier bcf90ceb8a Externalize creator for XPath rule 2020-04-08 21:35:34 +02:00
Clément Fournier fc304bf70c Add XPath version maker 2020-04-08 21:35:34 +02:00
Andreas Dangel fc88b79b92 Fix build under windows 2020-04-07 19:42:23 +02:00
Andreas Dangel c7941638e8 Merge branch 'pr-2401'
[doc] Update DoNotUseThreads rule documentation #2401
2020-04-06 20:21:32 +02:00
Andreas Dangel 4c0a47e2b7 [doc] Update release notes, refs #2401, fixes 2313 2020-04-06 20:20:51 +02:00
Andreas Dangel 41c56803af Merge branch 'pr-2403'
[java] #2402 fix false-positives on Primitive Streams #2403
2020-04-06 20:07:55 +02:00
Andreas Dangel d64ea87bbc [doc] Update release notes, refs #2403, fixes #2402 2020-04-06 20:07:47 +02:00
Andreas Dangel d23d44c308 [core] Add JsonRenderer
Fixes #1286
2020-04-05 20:13:53 +02:00
Bernd Farka f28bdbed5e issue 2402 fix false-positives on Primitive Streams 2020-04-05 19:47:52 +02:00
Saikat dcde4258b3 Update DoNotUseThreads rule documentation
Fixes #2313 [java] Documentation for DoNotUseThreads is outdated
2020-04-05 11:46:51 +05:30
Andreas Dangel 0356895cc2 [doc] Fix github issue templates
The labels were wrong, maybe now they are assigned
automatically...
2020-04-04 18:29:50 +02:00
Andreas Dangel 69ed0464a7 Merge branch 'pr-2385'
[java] Make yield statements more conditional #2385

Fixes #2319
2020-04-04 18:20:49 +02:00
Andreas Dangel 5ed8570703 Add new rule: apex/bestpractices.xml/UnusedLocalVariable 2020-04-04 18:09:44 +02:00
Andreas Dangel a86e172b98 Merge branch 'pr-2395'
[apex] New Rule: Unused local variables #2395
2020-04-04 18:08:41 +02:00
Andreas Dangel cdbb4570b4 [doc] Update release notes, refs #2395 2020-04-04 18:07:28 +02:00
Andreas Dangel 9db695eee2 [apex] Add additional test case for unused local var shadowing a field 2020-04-04 18:07:23 +02:00
Andreas Dangel 2f33951f60 Add new rules ruleset for release 6.23.0 2020-04-04 17:49:09 +02:00
Andreas Dangel 6196da44b0 Merge branch 'pr-2396'
[apex] New rule: field declarations should be at start #2396
2020-04-04 17:44:07 +02:00
Andreas Dangel 92a518c991 [doc] Update release notes, refs #2396 2020-04-04 17:43:14 +02:00
Andreas Dangel f1759c68c6 [apex] Move new rule def up in codestyle.xml 2020-04-04 17:38:13 +02:00
Andreas Dangel 130fee68de Merge branch 'pr-2376'
[doc] Add missing doc about pmd.github.io #2376
2020-04-04 10:56:24 +02:00
Andreas Dangel d3b45e5d96 Merge branch 'pr-2370'
[doc] Improve documentation about incremental analysis #2370
2020-04-04 10:54:35 +02:00
Andreas Dangel a04964c32a Merge branch 'pr-2392'
[java] Fix UseDiamondOperator false positive inside lambda #2392
2020-04-04 10:44:32 +02:00
Andreas Dangel e064a5f5ca [doc] Update release notes, fixes #1723 2020-04-04 10:43:52 +02:00
Andreas Dangel 9155a31b2a Merge branch 'pr-2397'
[apex] fixed WITH SECURITY_ENFORCED regex to recognise line break characters #2397
2020-04-04 10:21:25 +02:00
Andreas Dangel e47a6b0007 [doc] Update release notes, refs #2397, fixes #2399 2020-04-04 10:21:18 +02:00
Kieran Black 746797e805 added tests for line breaks 2020-04-03 15:43:56 -04:00
Andreas Dangel ad82444087 [java] Optimize some XPath 2.0 rules
ProperCloneImplementation,
JUnit4SuitesShouldUseSuiteAnnotation,
AbstractClassWithoutAbstractMethod,
AvoidDecimalLiteralsInBigDecimalConstructor,
JUnitStaticSuite
2020-04-03 20:38:46 +02:00
Andreas Dangel 256a7cd565 [java] Fix annotation check for unit test rules 2020-04-03 19:48:46 +02:00
Andreas Dangel 6e38eaec31 [java] Optimize XPath rules that use count(x)=0 2020-04-03 18:29:00 +02:00
Kieran Black d09d4de308 fixed WITH SECURITY_ENFORCED regex to recognise line break characters 2020-04-03 12:25:22 -04:00
Andreas Dangel 4c712d467d [java] Refactor JUnit specific rules that use ancestor axis 2020-04-03 17:03:00 +02:00
Gwilym Kuiper 7b06d3001f Make UnusedLocalVariableRule a rule chain rule 2020-04-03 15:27:37 +01:00
Andreas Dangel 3e932de647 Merge branch 'master' into pr-2377 2020-04-03 16:25:22 +02:00
Gwilym Kuiper 6a70bda5e6 Should be 6.23.0 for release 2020-04-03 15:19:12 +01:00
Gwilym Kuiper e94db8bf22 Make rule a RuleChain 2020-04-03 15:18:22 +01:00
Gwilym Kuiper 58185fce2f Extract constant 2020-04-03 15:17:29 +01:00
Gwilym Kuiper 1331eec208 Make comment clearer 2020-04-03 15:17:01 +01:00
Gwilym Kuiper 4aae0e2ebf Fix checkstyle violations 2020-04-03 15:16:52 +01:00
Gwilym Kuiper 9e07836659 Correctly detect fields that appear after static initialization blocks 2020-04-03 15:10:30 +01:00
Gwilym Kuiper 292bcbbf04 Correctly detect that fields should go before block statements 2020-04-03 15:01:56 +01:00
Andreas Dangel 04f0bb78b9 Merge branch 'pr-2380'
[java] Make TypeHelper use the class loading cache of ClassTypeResolver #2380
2020-04-03 15:41:09 +02:00
Andreas Dangel e30e229cf5 [doc] Update release notes, fixes #2378 2020-04-03 15:40:10 +02:00
Andreas Dangel b84e4dba88 Merge branch 'pr-2372'
[core] Deprecations for token managers #2372
2020-04-03 15:19:52 +02:00
Andreas Dangel 9385feb0e7 [doc] Update release notes, refs #2372 2020-04-03 15:19:43 +02:00
Gwilym Kuiper eeac579661 Correctly detect properties before fields 2020-04-03 13:58:49 +01:00
Gwilym Kuiper 5d1ffa5a55 Correctly detect fields after inner classes 2020-04-03 13:57:34 +01:00
Gwilym Kuiper 1359c88e90 Also produce errors in inner classes 2020-04-03 13:48:31 +01:00
Gwilym Kuiper eb8e7eabd8 Fix field declaration location rule around nested classes 2020-04-03 13:45:34 +01:00
Gwilym Kuiper 9c13702e39 Massively simplify rule with custom comparator 2020-04-03 13:38:40 +01:00
Gwilym Kuiper 41f6a595a9 Include variable name in violation message 2020-04-01 11:58:32 +01:00
Gwilym Kuiper 504cf440a3 Inculde field name in violation message 2020-04-01 11:55:50 +01:00
Gwilym Kuiper 3f0dc27a4a Add tests for apex field declarations should be at start 2020-04-01 11:47:32 +01:00
Gwilym Kuiper 1d62a1f984 Add rule definition in codestyle.xml 2020-04-01 11:28:14 +01:00
Gwilym Kuiper 8acb63870c Add basic implmentation of FieldDeclarationsShouldBeAtStart for apex 2020-04-01 11:24:34 +01:00
Gwilym Kuiper abbe46c7ba Add another test for variable usage in blocks 2020-04-01 09:28:18 +01:00
Gwilym Kuiper 705fa2563a Fixup checkstyle issues 2020-04-01 09:28:11 +01:00
Gwilym Kuiper 80c26bf537 Add tests and fix up issues found while writing them 2020-04-01 09:15:04 +01:00
Gwilym Kuiper 29cef7f23d Add rule to bestpractices.xml 2020-04-01 09:15:01 +01:00
Clément Fournier 4d17358746 Fix FP with array creation 2020-03-30 16:48:42 +02:00
Gwilym Kuiper d95763c504 Basic implementation of detecting apex unused local variables 2020-03-30 10:54:58 +01:00
Clément Fournier eb7949045f Isolate version-sensitive tests 2020-03-30 10:23:41 +02:00
Clément Fournier e58eb0f017 Fix UseDiamondOperator
Fixes #1723
2020-03-30 09:59:23 +02:00
Andreas Dangel a3cd0cf47d Merge branch 'pr-2384' #2384
[java] Performance improve xpath based rules
2020-03-29 17:26:26 +02:00
Andreas Dangel 961e2b2244 [doc] Update release notes, fixes #2390 2020-03-29 17:25:11 +02:00
Clément Fournier 5cbfdfdd99 Use ascii printer for tree dumps
Some environments may not display
the structure correctly otherwise. See
eg https://travis-ci.org/github/pmd/pmd/jobs/668122788#L9312-L9322
2020-03-29 09:21:38 +02:00
Clément Fournier e84349531b Normalize line endings 2020-03-29 09:17:49 +02:00
Clément Fournier e89c54fcf9 Cleanup 2020-03-28 18:01:32 +01:00
Clément Fournier f36835638f Add some scala tests 2020-03-28 17:46:33 +01:00
Clément Fournier 89cddd8aa8 Use parsing helper 2020-03-28 17:46:33 +01:00
Clément Fournier 09ddc628cd Fix reference files 2020-03-28 17:46:33 +01:00
Clément Fournier c83790fab5 Recycle tree printer from the designer 2020-03-28 17:46:33 +01:00
Clément Fournier bb92044a15 Add ability to test an AST dump as cheap regression test 2020-03-28 17:46:32 +01:00
Clément Fournier b7af5fb4db Fix ClassWithOnlyPrivateConstructorsShouldBeFinal
Refs #1938
2020-03-28 17:41:10 +01:00
Clément Fournier 01c2389f58 Merge branch 'master' into xpath-update-rules 2020-03-28 17:32:22 +01:00
Clément Fournier ac23b2cb3d Merge branch 'grammar-compact-records' 2020-03-28 15:10:56 +01:00
Clément Fournier b308cc12c6 Merge branch 'saxon-rulechain-excludes' 2020-03-28 15:08:40 +01:00
Clément Fournier e1a4b8ae97 Forbid type params for record ctors 2020-03-28 11:43:20 +01:00
Clément Fournier 7c433f8820 Remove import to reduce diff 2020-03-28 11:36:42 +01:00
Clément Fournier b01d4dc0d7 Test 2020-03-28 11:36:42 +01:00
Clément Fournier 9e9c370a4a Make yield more conditional
Refs #2319
2020-03-28 11:36:38 +01:00
Clément Fournier 485fa4ad50 Fix test case name 2020-03-28 11:06:10 +01:00
Clément Fournier 552931d965 Fix AbstractClassWithoutAnyMethods FN with inner classes 2020-03-28 11:03:40 +01:00
Andreas Dangel 409b35d4aa [doc] Update release notes, refs #2383, fixes #2358 2020-03-27 22:35:06 +01:00
Robert Sösemann 6042b69385 Merge pull request #2383 from gwilymatgearset/fix-invalid-apex-in-documentation
[apex] Fix invalid apex in documentation
2020-03-27 19:14:09 +01:00
Andreas Dangel 25ef59d5a7 [java] Performance improve xpath based rules
If an unbounded path expression like

    //PrimaryExpression[//ClassOrInterfaceDeclaration]

is used, then this will search the whole document again.
It will also avoid using rule chain later on, see #2382
2020-03-27 18:41:05 +01:00
Gwilym Kuiper 954f6b09d5 int -> Integer in apex/errorprone.xml 2020-03-27 16:50:53 +00:00
Gwilym Kuiper 315afeae90 Fixup whitespace 2020-03-27 16:50:15 +00:00
Gwilym Kuiper 25139da564 int -> Integer and float -> Double 2020-03-27 16:48:59 +00:00
Gwilym Kuiper 0bd1523172 Fix typo in method 2020-03-27 16:47:51 +00:00
Gwilym Kuiper 4139fd4dd2 Integer rather than int 2020-03-27 16:47:18 +00:00
Gwilym Kuiper 1e286ed281 Fixup indentation in apex/bestpractices.xml 2020-03-27 16:46:10 +00:00
Andreas Dangel 263c6e0d09 [core] Apply PR review suggestions, refs #2382 2020-03-27 17:46:07 +01:00
Gwilym Kuiper 22c66fde27 Add returns to setPhoneNumberIfNotExisting in documentation 2020-03-27 16:44:36 +00:00
Andreas Dangel 8ffe160f12 [core] saxon rulechain: consider boolean expr 2020-03-27 13:35:51 +01:00
Andreas Dangel a0e1e40bcb [core] saxon rulechain: don't use rule chain for other path expressions 2020-03-27 12:58:38 +01:00
Clément Fournier 105e48b8e1 Fix TypeHelper array loading 2020-03-23 23:00:39 +01:00
Clément Fournier acbecf3e65 Add tests 2020-03-23 22:05:29 +01:00
Clément Fournier 549a49790c Doc 2020-03-23 21:44:10 +01:00
Clément Fournier 633319015b Fix when the type is nullable 2020-03-23 21:04:34 +01:00
Clément Fournier a2994a97d9 Fast path annotation types 2020-03-23 20:57:51 +01:00
Clément Fournier 96532f26cc Make typeIs XPath functions use the typeres cache 2020-03-23 20:49:43 +01:00
Clément Fournier 17ddfd2a22 Merge branch 'master' of github.com:pmd/pmd 2020-03-21 20:04:49 +01:00
Clément Fournier 0280668a51 [apex] Replace usages of AbstractApexNode in rules by ApexNode 2020-03-21 20:04:38 +01:00
Andreas Dangel 4ec1901680 Merge branch 'pr-2314' #2314
[doc] maven integration - Add version to plugin
2020-03-21 12:14:24 +01:00
Andreas Dangel ce07c9b757 [doc] Update release notes, refs #2314 2020-03-21 12:13:23 +01:00
Andreas Dangel 4f392c9d25 [doc] maven - add "Choosing the plugin version" 2020-03-21 12:12:24 +01:00
Andreas Dangel fe3b8f0f1c Merge branch 'issue-templates' #2286
[doc] Add github issue templates
2020-03-21 11:45:07 +01:00
Andreas Dangel 40d7d27665 [doc] Update issue template for bug reports and rule violations 2020-03-21 11:44:22 +01:00
Andreas Dangel 843f473252 Fix formatting 2020-03-21 11:27:40 +01:00
Andreas Dangel 16162a1135 [doc] Add missing doc about pmd.github.io
Fixes #2356
2020-03-21 11:24:42 +01:00
Andreas Dangel 153d669d02 [doc] Add example with Maven dependency management 2020-03-21 09:35:30 +01:00
Clément Fournier 3d429019ee Fix rules 2020-03-20 18:47:40 +01:00
Clément Fournier 0d65c2e6e6 Add relevant property tag 2020-03-20 18:47:40 +01:00
Clément Fournier eaceefc39e Update XPath rules to 2.0 2020-03-20 18:47:40 +01:00
Clément Fournier 30886544c5 Deprecations to clean up CPD 2020-03-20 18:00:16 +01:00
Andreas Dangel cffb453276 [doc] Improve documentation about incremental analysis
Fixes #2355
2020-03-20 14:56:41 +01:00
Clément Fournier 3269b48add Merge branch 'saxon-rulechain' 2020-03-20 14:47:31 +01:00
Clément Fournier f927a561b5 Update release notes, refs #2354 2020-03-20 14:46:21 +01:00
Andreas Dangel 31bf08af54 Merge branch 'issue-628' #628
[swift][cpd]Running CPD throw StackOverflowError
2020-03-20 13:55:16 +01:00
Andreas Dangel 56d5a6afa3 [swift] Add unit test for #628
Closes #628
2020-03-20 13:55:04 +01:00
Andreas Dangel 08f9a3956e Merge branch 'pr-2363' #2363
[core] Add more bindings for the designer
2020-03-20 12:18:21 +01:00
Andreas Dangel c0b70bdbc7 [core] Rename DesignerBindings.AdditionalInfo::getSortKey 2020-03-20 12:14:34 +01:00
Clément Fournier a899a25350 Fix expr normalization when ids are negative 2020-03-19 19:29:13 +01:00
Clément Fournier 514a524e6f Checkstyle 2020-03-19 19:22:35 +01:00
Clément Fournier 20a3c39b4d Make SplitUnions package private 2020-03-19 19:11:30 +01:00
Clément Fournier 45d4fc5f56 Make documentSorter singleton 2020-03-19 19:08:19 +01:00
Andreas Dangel e2229b2d84 [core] Saxon XPath 2.0 and rule chain with visitors
This is an enhanced implementation of rule chain
support for XPath 2.0 expressions. It uses a own
visitor to analyze and modify the original
saxon xpath expressions.
2020-03-19 11:28:26 +01:00
Clément Fournier f1a6796b78 Checkstyle 2020-03-18 22:41:01 +01:00
Clément Fournier 8fb9d2e74d Implement for java 2020-03-17 19:57:22 +01:00
Clément Fournier 87ba035aa6 Add bindings for the designer treeview 2020-03-17 19:56:25 +01:00
Clément Fournier c38f94cad7 Declare modelica namespace 2020-03-17 16:21:12 +01:00
Clément Fournier 3d861f63cc Fix dead link 2020-03-17 15:57:21 +01:00
Clément Fournier d212c79f58 Remove redundant section in release notes 2020-03-17 15:10:28 +01:00
Clément Fournier 138c0e3e86 Deprecate tokManagers for more module 2020-03-17 15:08:58 +01:00
Clément Fournier 3ac135640a Merge deprecation sections for all ASTs
Also deprecate JSP token manager
2020-03-17 15:01:56 +01:00
Clément Fournier d6ef129d80 Merge branch 'deprecate-plsql-ast' 2020-03-17 14:49:41 +01:00
Clément Fournier f827d05819 Merge branch 'deprecate-vf-ast' 2020-03-17 14:49:33 +01:00
Clément Fournier 941bb10d1c Internalise PLSQL token manager 2020-03-17 14:48:37 +01:00
Clément Fournier 77112d2b9f Merge branch 'master' into deprecate-plsql-ast 2020-03-17 14:48:03 +01:00
Clément Fournier c24ac34c03 Merge branch 'master' into deprecate-vf-ast 2020-03-17 14:46:53 +01:00
Clément Fournier e1069b4a33 Fix *ParserVisitor itf being deprecated
refs #2239
2020-03-17 14:42:29 +01:00
Clément Fournier eae54da5d0 Merge branch 'master' into deprecate-vf-ast 2020-03-17 14:34:31 +01:00
Clément Fournier 9f4bc75829 Internalize token manager 2020-03-17 14:33:16 +01:00
Andreas Dangel 5ff0814120 Merge branch 'pr-2312'
[apex] Update ApexCRUDViolation Rule
2020-03-14 18:27:19 +01:00
Andreas Dangel 4c158531b8 [doc] Update release notes, refs #2312, fixes #2210 2020-03-14 18:17:02 +01:00
Andreas Dangel 383713fdbd [apex] Small refactorings in ApexCRUDViolationRule
To avoid some deprecations
2020-03-14 18:16:52 +01:00
Andreas Dangel 520bf0e343 Merge branch 'pr-2353'
[plsql] xmlforest with optional AS
2020-03-14 17:48:25 +01:00
Andreas Dangel dd2c14f55a [doc] Update release notes, refs #2353 2020-03-14 17:47:57 +01:00
Andreas Dangel 3570796384 [plsql] Enhance test for XMLFOREST 2020-03-14 17:46:20 +01:00
Andreas Dangel 0b88caacea [core] Add more cases for Saxon rule chain 2020-03-13 20:48:35 +01:00
Andreas Dangel 5fb6df7daa [core] Add support for rule chain execution for XPath 2.0
Very similar approach to what has been implemented for Jaxen.
The existing rules still work as before.

Refs #1687
2020-03-13 15:29:20 +01:00
Piotr Szymanski ee9f82166a fixed grammar 2020-03-13 13:50:24 +01:00
Piotr Szymanski a355f06b90 xmlforest with optional AS 2020-03-13 12:19:25 +01:00
Andreas Dangel b487ef94d0 [python] Deprecate/Internalize PythonTokenManager
Refs #2293
2020-03-13 10:30:43 +01:00
Andreas Dangel c2f35584ca [java] Deprecate/Internalize JavaTokenManager 2020-03-13 09:43:59 +01:00
Andreas Dangel 70f1f511e4 [vm] Deprecate/Internalize VmTokenManager
Refs #2289
2020-03-13 09:43:26 +01:00
Joshua Arquilevich be72ec153d Fixed more style changes and improved logic 2020-03-12 14:06:13 -07:00
Andreas Dangel 4c1fa78192 Update pmd to 6.22.0 2020-03-12 18:50:55 +01:00
Andreas Dangel a0b4c4fe0a Prepare next development version 2020-03-12 15:16:48 +01:00
Andreas Dangel 4c020bfbf7 [maven-release-plugin] prepare for next development iteration 2020-03-12 15:15:18 +01:00
shilko2013 edbc060aa1 Update UnusedPrivateMethodRule.java
Add break
2020-03-11 20:52:22 +03:00
Joshua Arquilevich 7b34f04be1 create a local pattern for the class and update isSecurityEnforced 2020-03-09 15:55:48 -07:00
szyman23 99a9115dc1 Merge pull request #1 from pmd/master
Sync
2020-03-06 12:35:31 +01:00
Andreas Dangel 53a94b3844 [plsql] Deprecate AST constructors and setters
Also remove useless javadoc comments and fix license header
2020-03-06 09:15:25 +01:00
Andreas Dangel 34b55a7c90 Update release notes 2020-03-05 20:42:40 +01:00
Andreas Dangel 5f7216f374 [vf] Deprecate AST constructors and setters
Also remove useless javadoc comments and fix license header
2020-03-05 20:39:05 +01:00
Joshua Arquilevich 57279e11db Fixed styling errors during build 2020-02-28 14:21:41 -08:00
Pham Hai Trung 9cec4c3ac7 Add version to plugin
The maven configuration will generate an issue if we don't specify the maven-pmd-plugin's version. Without the version, maven wouldn't be able to find the pmd plugin in central.
2020-02-27 09:38:43 +01:00
Joshua Arquilevich 6efc10eb4c Fixed syntax error with 'Accepts Clause WITH SECURITY_ENFORCED in a list' Test 2020-02-25 16:08:18 -08:00
Joshua Arquilevich 7bbb65720a Removed 'Accepts Clause WITH SECURITY_ENFORCED Failed' Test 2020-02-25 10:10:33 -08:00
Joshua Arquilevich a2aba08c9a Updated regex 2020-02-24 16:27:12 -08:00
Joshua Arquilevich c54c9887a9 Updated the regex to support case insensitivity in apex 2020-02-20 15:57:46 -08:00
Joshua Arquilevich 8b94463074 Modify CURD rule to support regex for SECURITY_ENFORCE clause 2020-02-20 15:31:19 -08:00
Joshua Arquilevich df16093562 Modify CURD rule to support SECURITY_ENFORCE clause 2020-02-20 12:03:01 -08:00
Andreas Dangel ae9dec9c5e [doc] Add github issue templates
Refs #2249
2020-02-13 18:41:16 +01:00
2226 changed files with 134841 additions and 79603 deletions

No files matched your search

+154
View File
@@ -0,0 +1,154 @@
# PMD CI Scripts
This folder contains scripts used for CI, that are PMD specific.
It uses the common scripts from [build-tools](https://github.com/pmd/build-tools).
## .ci/files/public-env.gpg
This files contains the following environment variables:
* DANGER_GITHUB_API_TOKEN: Token for danger to add comments to PRs as <https://github.com/pmd-test>.
The token needs the scope "public_repo".
* PMD_CI_CHUNK_TOKEN: Token for uploading reports to chunk.io
The file is encrypted, so that the tokens are not automatically disabled when github detects them
in clear text.
**Decrypting**:
gpg --batch --yes --decrypt --passphrase="GnxdjywUEPveyCD1RLiTd7t8CImnefYr" \
--output .ci/files/public-env .ci/files/public-env.gpg
**Encrypting**:
gpg --batch --symmetric --cipher-algo AES256 \
--armor --passphrase="GnxdjywUEPveyCD1RLiTd7t8CImnefYr" \
--output .ci/files/public-env.gpg .ci/files/public-env
## Local tests with docker
Using the same docker container as described in [build-env @ build-tools](https://github.com/pmd/build-tools).
### Testing a push build (snapshot)
Start docker without binding to local directory, so that we can do a fresh checkout
$ docker run \
--interactive \
--tty \
--name pmd-build-env_pmd \
pmd-build-env:latest
```
export LANG=en_US.UTF-8
export PMD_CI_SCRIPTS_URL=https://raw.githubusercontent.com/pmd/build-tools/master/scripts
export PMD_CI_SECRET_PASSPHRASE="xyz"
export PMD_CI_DEBUG=true
MAIN_BRANCH="master"
eval $(~/create-gh-actions-env.sh push pmd/pmd $MAIN_BRANCH)
cd /workspaces/pmd
rmdir pmd && mkdir pmd
cd pmd
git init
git remote add origin https://github.com/pmd/pmd
git fetch --no-tags --prune --progress --no-recurse-submodules --depth=2 origin +refs/heads/${MAIN_BRANCH}:refs/remotes/origin/${MAIN_BRANCH}
git checkout --progress --force -B ${MAIN_BRANCH} refs/remotes/origin/${MAIN_BRANCH}
f=check-environment.sh; \
mkdir -p .ci && \
( [ -e .ci/$f ] || curl -sSL "${PMD_CI_SCRIPTS_URL}/$f" > ".ci/$f" ) && \
chmod 755 .ci/$f && \
.ci/$f
.ci/build.sh
```
### Testing a pull request
Same as the above, but this line changes:
```
eval $(~/create-gh-actions-env.sh pull_request pmd/pmd $MAIN_BRANCH)
```
Maybe update `/workspaces/event.json` to fill in a real pull request number, so that
danger can comment the correct PR.
And the checkout must be different. Example for PR 3220:
```
PMD_CI_PULL_REQUEST_NUMBER=3220
cd /workspace/pmd
rmdir pmd && mkdir pmd
cd pmd
git init
git remote add origin https://github.com/pmd/pmd
git fetch --no-tags --prune --progress --no-recurse-submodules --depth=2 origin +refs/pull/${PMD_CI_PULL_REQUEST_NUMBER}/merge:refs/remotes/pull/${PMD_CI_PULL_REQUEST_NUMBER}/merge
git checkout --progress --force refs/remotes/pull/${PMD_CI_PULL_REQUEST_NUMBER}/merge
```
### Forked build
A build executing on a forked repository.
```
$(~/create-gh-actions-env.sh push adangel/pmd $MAIN_BRANCH)
```
### Performing a release (push) build
```
export LANG=en_US.UTF-8
export PMD_CI_SCRIPTS_URL=https://raw.githubusercontent.com/pmd/build-tools/master/scripts
export PMD_CI_SECRET_PASSPHRASE="xyz"
export PMD_CI_DEBUG=true
TAG_NAME=pmd_releases/6.33.0
eval $(~/create-gh-actions-env.sh push pmd/pmd refs/tags/$TAG_NAME)
cd /workspaces/pmd
rmdir pmd && mkdir pmd
cd pmd
git init
git remote add origin https://github.com/pmd/pmd
git fetch --no-tags --prune --progress --no-recurse-submodules --depth=2 origin +refs/tags/$TAG_NAME:refs/tags/$TAG_NAME
git checkout --progress --force refs/tags/$TAG_NAME
f=check-environment.sh; \
mkdir -p .ci && \
( [ -e .ci/$f ] || curl -sSL "${PMD_CI_SCRIPTS_URL}/$f" > ".ci/$f" ) && \
chmod 755 .ci/$f && \
.ci/$f
#
# .ci/build.sh
#
```
Calling `.ci/build.sh` directly would re-release the tag $TAG_NAME - that's why it is commented out.
All the side-effects of a release would be carried out like creating and publishing a release on github,
uploading the release to sourceforge, uploading the docs to pmd.github.io/docs.pmd-code.org, uploading a
new baseline for the regression tester and so on. While the release should be reproducible and therefore should
produce exactly the same artifacts, re-uploading artifacts is not desired just for testing.
Note that maven-central would not be changed, since this is skipped via MAVEN_OPTS:
`MAVEN_OPTS` contains `-DskipRemoteStaging=true`, so that no maven artifacts are deployed
to maven central (this is set by `create-gh-actions-env.sh`).
So for now in order to test the build script, you need to manually edit the script and comment out the
critical lines... (like publish github releases, uploading files to sourceforge ...). Later a
"dry-run" mode could be added.
Make sure to cleanup after the test, e.g. discard the draft github release.
## Workflow git-repo-sync
Synchronizes the github git repository pmd/pmd on every push to sourceforge.
Executable
+232
View File
@@ -0,0 +1,232 @@
#!/usr/bin/env bash
# Exit this script immediately if a command/function exits with a non-zero status.
set -e
SCRIPT_INCLUDES="log.bash utils.bash setup-secrets.bash openjdk.bash maven.bash github-releases-api.bash
sourceforge-api.bash pmd-doc.inc pmd-code-api.inc regression-tester.inc"
# shellcheck source=inc/fetch_ci_scripts.bash
source "$(dirname "$0")/inc/fetch_ci_scripts.bash" && fetch_ci_scripts
function build() {
pmd_ci_log_group_start "Prepare Java 7+11, Bundler"
pmd_ci_openjdk_install_adoptopenjdk 11
pmd_ci_openjdk_setdefault 11
PMD_MAVEN_EXTRA_OPTS=()
if [ "$(pmd_ci_utils_get_os)" = "linux" ]; then
pmd_ci_log_info "Install openjdk7 for integration tests"
pmd_ci_openjdk_install_zuluopenjdk 7
PMD_MAVEN_EXTRA_OPTS=(-Djava7.home="${HOME}/openjdk7")
fi
pmd_ci_build_setup_bundler
pmd_ci_log_group_end
echo
pmd_ci_maven_display_info_banner
pmd_ci_utils_determine_build_env pmd/pmd
echo
if pmd_ci_utils_is_fork_or_pull_request; then
pmd_ci_log_group_start "Build with mvnw"
./mvnw clean verify --show-version --errors --batch-mode --no-transfer-progress "${PMD_MAVEN_EXTRA_OPTS[@]}"
pmd_ci_log_group_end
# Danger is executed only on the linux runner
if [ "$(pmd_ci_utils_get_os)" = "linux" ]; then
pmd_ci_log_group_start "Executing danger"
regression_tester_setup_ci
regression_tester_executeDanger
pmd_ci_log_group_end
fi
exit 0
fi
# stop early for invalid maven version and branch/tag combination
pmd_ci_maven_verify_version || exit 0
if [ "$(pmd_ci_utils_get_os)" != "linux" ]; then
pmd_ci_log_group_start "Build with mvnw"
./mvnw clean verify --show-version --errors --batch-mode --no-transfer-progress "${PMD_MAVEN_EXTRA_OPTS[@]}"
pmd_ci_log_group_end
pmd_ci_log_info "Stopping build here, because os is not linux"
exit 0
fi
# only builds on pmd/pmd continue here
pmd_ci_log_group_start "Setup environment"
pmd_ci_setup_secrets_private_env
pmd_ci_setup_secrets_gpg_key
pmd_ci_setup_secrets_ssh
pmd_ci_maven_setup_settings
pmd_ci_log_group_end
pmd_ci_log_group_start "Build and Deploy"
pmd_ci_build_run
pmd_ci_deploy_build_artifacts
pmd_ci_log_group_end
pmd_ci_log_group_start "Build and Upload documentation"
pmd_ci_build_and_upload_doc
pmd_ci_log_group_end
if pmd_ci_maven_isReleaseBuild; then
pmd_ci_log_group_start "Publishing Release"
pmd_ci_gh_releases_publishRelease "$GH_RELEASE"
pmd_ci_sourceforge_selectDefault "${PMD_CI_MAVEN_PROJECT_VERSION}"
pmd_ci_sourceforge_publishBlogPost "$SF_BLOG_URL"
pmd_ci_log_group_end
fi
pmd_ci_log_group_start "Creating new baseline for regression tester"
regression_tester_setup_ci
regression_tester_uploadBaseline
pmd_ci_log_group_end
if pmd_ci_maven_isSnapshotBuild; then
pmd_ci_log_group_start "Executing build with sonar"
# Note: Sonar also needs GITHUB_TOKEN (!)
./mvnw \
-Dmaven.javadoc.skip=true \
-Dmaven.source.skip \
-Dcheckstyle.skip \
-Dpmd.skip \
--show-version --errors --batch-mode --no-transfer-progress \
clean package \
sonar:sonar -Dsonar.login="${SONAR_TOKEN}" -Psonar
pmd_ci_log_success "New sonar results: https://sonarcloud.io/dashboard?id=net.sourceforge.pmd%3Apmd"
pmd_ci_log_group_end
pmd_ci_log_group_start "Executing build with coveralls"
export CI_NAME="github actions"
export CI_BUILD_URL="${PMD_CI_JOB_URL}"
export CI_BRANCH="${PMD_CI_BRANCH}"
./mvnw \
-Dmaven.javadoc.skip=true \
-Dmaven.source.skip \
-Dcheckstyle.skip \
-Dpmd.skip \
-DrepoToken="${COVERALLS_REPO_TOKEN}" \
--show-version --errors --batch-mode --no-transfer-progress \
clean package jacoco:report \
coveralls:report -Pcoveralls
pmd_ci_log_success "New coveralls result: https://coveralls.io/github/pmd/pmd"
pmd_ci_log_group_end
fi
}
#
# Installs bundler, which is needed for doc generation and regression tester
#
function pmd_ci_build_setup_bundler() {
pmd_ci_log_info "Installing bundler..."
gem install bundler
}
#
# Performs the actual build.
# Deploys the artifacts to maven central.
# Also generates rule documentation.
#
function pmd_ci_build_run() {
local mvn_profiles="sign,generate-rule-docs"
if pmd_ci_maven_isReleaseBuild; then
pmd_ci_log_info "This is a release build"
mvn_profiles="${mvn_profiles},pmd-release"
else
pmd_ci_log_info "This is a snapshot build"
fi
./mvnw clean deploy -P${mvn_profiles} --show-version --errors --batch-mode --no-transfer-progress "${PMD_MAVEN_EXTRA_OPTS[@]}"
}
#
# Deploys the binary distribution
#
function pmd_ci_deploy_build_artifacts() {
# Deploy to sourceforge files
pmd_ci_sourceforge_uploadFile "pmd/${PMD_CI_MAVEN_PROJECT_VERSION}" "pmd-dist/target/pmd-bin-${PMD_CI_MAVEN_PROJECT_VERSION}.zip"
pmd_ci_sourceforge_uploadFile "pmd/${PMD_CI_MAVEN_PROJECT_VERSION}" "pmd-dist/target/pmd-src-${PMD_CI_MAVEN_PROJECT_VERSION}.zip"
if pmd_ci_maven_isReleaseBuild; then
# create a draft github release
pmd_ci_gh_releases_createDraftRelease "${PMD_CI_TAG}" "$(git rev-list -n 1 "${PMD_CI_TAG}")"
GH_RELEASE="$RESULT"
# Deploy to github releases
pmd_ci_gh_releases_uploadAsset "$GH_RELEASE" "pmd-dist/target/pmd-bin-${PMD_CI_MAVEN_PROJECT_VERSION}.zip"
pmd_ci_gh_releases_uploadAsset "$GH_RELEASE" "pmd-dist/target/pmd-src-${PMD_CI_MAVEN_PROJECT_VERSION}.zip"
fi
}
#
# Builds and uploads the documentation site
#
function pmd_ci_build_and_upload_doc() {
pmd_doc_generate_jekyll_site
pmd_doc_create_archive
pmd_ci_sourceforge_uploadFile "pmd/${PMD_CI_MAVEN_PROJECT_VERSION}" "docs/pmd-doc-${PMD_CI_MAVEN_PROJECT_VERSION}.zip"
if pmd_ci_maven_isReleaseBuild; then
pmd_ci_gh_releases_uploadAsset "$GH_RELEASE" "docs/pmd-doc-${PMD_CI_MAVEN_PROJECT_VERSION}.zip"
fi
# Deploy doc to https://docs.pmd-code.org/pmd-doc-${PMD_CI_MAVEN_PROJECT_VERSION}/
pmd_code_uploadDocumentation "${PMD_CI_MAVEN_PROJECT_VERSION}" "docs/pmd-doc-${PMD_CI_MAVEN_PROJECT_VERSION}.zip"
# Deploy javadoc to https://docs.pmd-code.org/apidocs/*/${PMD_CI_MAVEN_PROJECT_VERSION}/
pmd_code_uploadJavadoc "${PMD_CI_MAVEN_PROJECT_VERSION}" "$(pwd)"
if pmd_ci_maven_isSnapshotBuild && [ "${PMD_CI_BRANCH}" = "master" ]; then
# only for snapshot builds from branch master
pmd_code_createSymlink "${PMD_CI_MAVEN_PROJECT_VERSION}" "snapshot"
# update github pages https://pmd.github.io/pmd/
pmd_doc_publish_to_github_pages
# rsync site to https://pmd.sourceforge.io/snapshot
pmd_ci_sourceforge_rsyncSnapshotDocumentation "${PMD_CI_MAVEN_PROJECT_VERSION}" "snapshot"
fi
if pmd_ci_maven_isReleaseBuild; then
# documentation is already uploaded to https://docs.pmd-code.org/pmd-doc-${PMD_CI_MAVEN_PROJECT_VERSION}
# we only need to setup symlinks for the released version
pmd_code_createSymlink "${PMD_CI_MAVEN_PROJECT_VERSION}" "latest"
# remove old doc and point to the new version
pmd_code_removeDocumentation "${PMD_CI_MAVEN_PROJECT_VERSION}-SNAPSHOT"
pmd_code_createSymlink "${PMD_CI_MAVEN_PROJECT_VERSION}" "${PMD_CI_MAVEN_PROJECT_VERSION}-SNAPSHOT"
# remove old javadoc
pmd_code_removeJavadoc "${PMD_CI_MAVEN_PROJECT_VERSION}-SNAPSHOT"
# updating github release text
rm -f .bundle/config
bundle config set --local path vendor/bundle
bundle config set --local with release_notes_preprocessing
bundle install
# renders, and skips the first 6 lines - the Jekyll front-matter
local rendered_release_notes
rendered_release_notes=$(bundle exec docs/render_release_notes.rb docs/pages/release_notes.md | tail -n +6)
local release_name
release_name="PMD ${PMD_CI_MAVEN_PROJECT_VERSION} ($(date -u +%d-%B-%Y))"
pmd_ci_gh_releases_updateRelease "$GH_RELEASE" "$release_name" "${rendered_release_notes}"
pmd_ci_sourceforge_uploadReleaseNotes "pmd/${PMD_CI_MAVEN_PROJECT_VERSION}" "${rendered_release_notes}"
local rendered_release_notes_with_links
rendered_release_notes_with_links="
* Downloads: https://github.com/pmd/pmd/releases/tag/pmd_releases%2F${PMD_CI_MAVEN_PROJECT_VERSION}
* Documentation: https://pmd.github.io/pmd-${PMD_CI_MAVEN_PROJECT_VERSION}/
${rendered_release_notes}"
pmd_ci_sourceforge_createDraftBlogPost "${release_name} released" "${rendered_release_notes_with_links}" "pmd,release"
SF_BLOG_URL="${RESULT}"
# updates https://pmd.github.io/latest/ and https://pmd.github.io/pmd-${PMD_CI_MAVEN_PROJECT_VERSION}
publish_release_documentation_github
pmd_ci_sourceforge_rsyncSnapshotDocumentation "${PMD_CI_MAVEN_PROJECT_VERSION}" "pmd-${PMD_CI_MAVEN_PROJECT_VERSION}"
fi
}
build
exit 0
File renamed without changes.
+103
View File
@@ -0,0 +1,103 @@
<?xml version="1.0"?>
<projectlist xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="projectlist_1_1_0.xsd">
<description>Standard Projects</description>
<project>
<name>checkstyle</name>
<type>git</type>
<connection>https://github.com/checkstyle/checkstyle</connection>
<tag>checkstyle-8.10</tag>
<exclude-pattern>.*/target/test-classes/com/puppycrawl/tools/checkstyle/.*</exclude-pattern>
<exclude-pattern>.*/target/generated-sources/.*</exclude-pattern>
<build-command><![CDATA[#!/usr/bin/env bash
if test -e classpath.txt; then
exit
fi
set -e
mvn test-compile
mvn dependency:build-classpath -DincludeScope=test -Dmdep.outputFile=classpath.txt
]]></build-command>
<auxclasspath-command>echo -n "$(pwd)/target/classes:$(pwd)/target/test-classes:"; cat classpath.txt</auxclasspath-command>
</project>
<project>
<name>spring-framework</name>
<type>git</type>
<connection>https://github.com/spring-projects/spring-framework</connection>
<tag>v5.0.6.RELEASE</tag>
<exclude-pattern>.*/build/generated-sources/.*</exclude-pattern>
<build-command><![CDATA[#!/usr/bin/env bash
if test -e classpath.txt; then
exit
fi
set -e
# Note: openjdk8 will be installed by "before_install.sh"
export JAVA_HOME=${HOME}/openjdk8
export PATH=$JAVA_HOME/bin:$PATH
# keep the tabs!!
(cat <<EOF
--- build.gradle 2020-11-14 09:43:51.705417551 +0000
+++ build.gradle.patched 2020-11-14 09:43:27.265215303 +0000
@@ -1,5 +1,6 @@
buildscript {
repositories {
+ mavenCentral()
maven { url "https://repo.spring.io/plugins-release" }
}
dependencies {
@@ -138,6 +139,7 @@
}
repositories {
+ mavenCentral()
maven { url "https://repo.spring.io/libs-release" }
}
@@ -314,3 +316,20 @@
}
return version
}
+
+task createSquishClasspath {
+ doLast {
+ def dependencies = new HashSet()
+ dependencies.addAll(subprojects.configurations.compile.resolvedConfiguration.resolvedArtifacts.file.flatten())
+ dependencies.addAll(subprojects.configurations.optional.resolvedConfiguration.resolvedArtifacts.file.flatten())
+ dependencies.addAll(subprojects.configurations.testCompile.resolvedConfiguration.resolvedArtifacts.file.flatten())
+ dependencies.addAll(subprojects.configurations.testRuntime.resolvedConfiguration.resolvedArtifacts.file.flatten())
+
+ def paths = new ArrayList()
+ paths.addAll(subprojects.jar.outputs.files.asPath)
+ paths.addAll(subprojects.sourceSets.test.output.resourcesDir)
+ paths.addAll(subprojects.sourceSets.test.output.classesDirs.files.flatten())
+ paths.addAll(dependencies)
+ println paths.join(File.pathSeparator)
+ }
+}
EOF
) | patch
./gradlew build testClasses -x javadoc -x dokka -x asciidoctor -x test -x testNG -x api -x distZip
./gradlew createSquishClasspath -q > classpath.txt
]]></build-command>
<auxclasspath-command>cat classpath.txt</auxclasspath-command>
</project>
<!---<project>
<name>openjdk10</name>
<type>hg</type>
<connection>http://hg.openjdk.java.net/jdk10/jdk10/jdk</connection>
<webview-url>http://hg.openjdk.java.net/jdk10/jdk10/jdk/file/777356696811</webview-url>
</project> -->
</projectlist>
+14
View File
@@ -0,0 +1,14 @@
-----BEGIN PGP MESSAGE-----
jA0ECQMC6NJFOgCtLK790sDsAV7zf22dX5W7Ki3LdPBesQvoN+fU5xjNcu9ytrOQ
pNDQybzmGkBU7gJM5sasTEv2OKp7h+nt8xSfaE8u0i4G0+yLGZKxbCrZoHnoBiaW
udpjvvxyKdEV8wn1DPsh/W9ARmxdJezpreUwmwExamYiVEXsWOr2DWST+DPVX+4I
5vAxi/YqO1/Pn+s/wIOKM/57otuVxwzwyUFxItJF4GV3NeCKt1cDQHRT1OSn2Mlw
1LY8oUJgjKVCzI9F7xSlHYRYtvUK2icc7lvwrUliXIlcVetUB6Swe5AJmtmQ63y0
EU52Uh7VPYjj929QgpoVpJHGTJl/Omyk63nb1EOrDWEVUMzg4fDsbAsmzvPyD/FR
R6S9OeJUCsLMXlu7MRHCQi0vDk3li25pVqJmFm9Ahk8tkY/yzgQLoWmVEOhl8xDY
oEQh0XNy9TxvzRzYlutYdU7K4ACohNsJN/MpKkRVzA3aMIBrNjVGa0dF8kd+7grg
fJ+MW8skcpIHDegDcxVAs+O4r9VO3UDAcx3E/kgdLAKSOV0sRt4ZbJZaML7sKkSV
muTtIhHzGwB41qKichY=
=fgy5
-----END PGP MESSAGE-----
+44
View File
@@ -0,0 +1,44 @@
#!/usr/bin/env bash
# Exit this script immediately if a command/function exits with a non-zero status.
set -e
SCRIPT_INCLUDES="log.bash utils.bash setup-secrets.bash"
# shellcheck source=inc/fetch_ci_scripts.bash
source "$(dirname "$0")/inc/fetch_ci_scripts.bash" && fetch_ci_scripts
function git_repo_sync() {
echo
pmd_ci_utils_determine_build_env pmd/pmd
echo
if pmd_ci_utils_is_fork_or_pull_request; then
pmd_ci_log_error "This should not run on forked repositories or pull requests"
exit 0
fi
# only builds on pmd/pmd continue here
pmd_ci_log_group_start "Setup environment"
pmd_ci_setup_secrets_private_env
pmd_ci_setup_secrets_gpg_key
pmd_ci_setup_secrets_ssh
pmd_ci_log_group_end
pmd_ci_log_group_start "Git Sync"
git remote add pmd-sf "${PMD_SF_USER}@git.code.sf.net:/p/pmd/code"
if [ -n "${PMD_CI_BRANCH}" ]; then
git push pmd-sf "${PMD_CI_BRANCH}:${PMD_CI_BRANCH}"
pmd_ci_log_success "Successfully pushed ${PMD_CI_BRANCH} to sourceforge"
elif [ -n "${PMD_CI_TAG}" ]; then
git push pmd-sf tag "${PMD_CI_TAG}"
pmd_ci_log_success "Successfully pushed tag ${PMD_CI_TAG} to sourceforge"
else
pmd_ci_log_error "Don't know what to do: neither PMD_CI_BRANCH nor PMD_CI_TAG is set"
exit 1
fi
pmd_ci_log_group_end
}
git_repo_sync
exit 0
+19
View File
@@ -0,0 +1,19 @@
#!/usr/bin/env bash
function fetch_ci_scripts() {
local inc_dir
local inc_url
inc_dir="$(dirname "$0")/inc"
inc_url="${PMD_CI_SCRIPTS_URL:-https://raw.githubusercontent.com/pmd/build-tools/master/scripts}/inc"
mkdir -p "${inc_dir}"
for f in ${SCRIPT_INCLUDES}; do
if [ ! -e "${inc_dir}/$f" ]; then
curl -sSL "${inc_url}/$f" > "${inc_dir}/$f"
fi
[ "$PMD_CI_DEBUG" = "true" ] && echo "loading ${inc_dir}/$f in ${MODULE:-$0}"
# shellcheck source=/dev/null
source "${inc_dir}/$f" || exit 1
done
}
+92
View File
@@ -0,0 +1,92 @@
#!/usr/bin/env bash
MODULE="pmd-code-api"
SCRIPT_INCLUDES="log.bash"
# shellcheck source=inc/fetch_ci_scripts.bash
source "$(dirname "$0")/inc/fetch_ci_scripts.bash" && fetch_ci_scripts
PMD_CODE_SSH_USER=pmd
PMD_CODE_DOCS_PATH=/docs.pmd-code.org/
function pmd_code_uploadDocumentation() {
local -r pmdVersion="$1"
local -r filename="$2"
local -r basefilename="$(basename "$filename")"
pmd_ci_log_debug "${FUNCNAME[0]} pmdVersion=$pmdVersion filename=$filename"
scp "${filename}" ${PMD_CODE_SSH_USER}@pmd-code.org:${PMD_CODE_DOCS_PATH}
# shellcheck disable=SC2029
ssh ${PMD_CODE_SSH_USER}@pmd-code.org "cd \"${PMD_CODE_DOCS_PATH}\" && \
unzip -qo \"${basefilename}\" && \
rm \"${basefilename}\""
pmd_ci_log_info "Docs updated: https://docs.pmd-code.org/pmd-doc-${pmdVersion}/"
}
function pmd_code_removeDocumentation() {
local pmdVersion="$1"
pmd_ci_log_debug "${FUNCNAME[0]} pmdVersion=$pmdVersion"
# shellcheck disable=SC2029
ssh ${PMD_CODE_SSH_USER}@pmd-code.org "cd \"${PMD_CODE_DOCS_PATH}\" && \
rm -rf \"pmd-doc-${pmdVersion}/\""
pmd_ci_log_info "Removed docs: https://docs.pmd-code.org/pmd-doc-${pmdVersion}/"
}
function pmd_code_createSymlink() {
local -r pmdVersion="$1"
local -r name="$2"
pmd_ci_log_debug "${FUNCNAME[0]} pmdVersion=$pmdVersion name=$name"
# shellcheck disable=SC2029
ssh ${PMD_CODE_SSH_USER}@pmd-code.org "cd \"${PMD_CODE_DOCS_PATH}\" && \
rm -f \"$name\" && \
ln -s \"pmd-doc-${pmdVersion}\" \"$name\""
pmd_ci_log_info "Symlink created: https://docs.pmd-code.org/$name/ -> https://docs.pmd-code.org/pmd-doc-${pmdVersion}/"
}
function pmd_code_uploadJavadoc() {
local -r pmdVersion="$1"
local -r basePath="$2"
pmd_ci_log_debug "${FUNCNAME[0]} pmdVersion=$pmdVersion basePath=$basePath"
for i in "${basePath}"/*/target/*-javadoc.jar */*/target/*-javadoc.jar; do
pmd_code_uploadJavadocModule "$pmdVersion" "$i"
done
# make sure https://docs.pmd-code.org/apidocs/ shows directory index
# shellcheck disable=SC2029
ssh ${PMD_CODE_SSH_USER}@pmd-code.org "cd \"${PMD_CODE_DOCS_PATH}/apidocs\" && \
echo 'Options +Indexes' > .htaccess"
pmd_ci_log_info "Directory index enabled for https://docs.pmd-code.org/apidocs/"
}
function pmd_code_uploadJavadocModule() {
local -r pmdVersion="$1"
local -r moduleJavadocJar="$2"
local -r moduleJavadocJarBasename="$(basename "$moduleJavadocJar")"
local -r module=${moduleJavadocJarBasename%%-${pmdVersion}-javadoc.jar}
pmd_ci_log_debug "${FUNCNAME[0]} pmdVersion=$pmdVersion moduleJavadocJar=$moduleJavadocJar module=$module"
scp "$moduleJavadocJar" ${PMD_CODE_SSH_USER}@pmd-code.org:${PMD_CODE_DOCS_PATH}
# shellcheck disable=SC2029
ssh ${PMD_CODE_SSH_USER}@pmd-code.org "cd \"${PMD_CODE_DOCS_PATH}\" && \
mkdir -p \"apidocs/${module}/${pmdVersion}\" && \
unzip -qo -d \"apidocs/${module}/${pmdVersion}\" \"${moduleJavadocJarBasename}\" && \
rm \"${moduleJavadocJarBasename}\""
pmd_ci_log_info "JavaDoc for $module uploaded: https://docs.pmd-code.org/apidocs/${module}/${pmdVersion}/"
}
function pmd_code_removeJavadoc() {
local -r pmdVersion="$1"
pmd_ci_log_debug "${FUNCNAME[0]} pmdVersion=$pmdVersion"
# shellcheck disable=SC2029
ssh ${PMD_CODE_SSH_USER}@pmd-code.org "cd \"${PMD_CODE_DOCS_PATH}\" && \
rm -rf apidocs/*/\"${pmdVersion}\""
pmd_ci_log_info "Removed Javadoc: https://docs.pmd-code.org/apidocs/*/${pmdVersion}/ is gone"
}
+117
View File
@@ -0,0 +1,117 @@
#!/usr/bin/env bash
MODULE="pmd-doc"
SCRIPT_INCLUDES="log.bash"
# shellcheck source=inc/fetch_ci_scripts.bash
source "$(dirname "$0")/inc/fetch_ci_scripts.bash" && fetch_ci_scripts
# Used env vars:
# PMD_CI_JOB_URL
# PMD_CI_PUSH_COMMIT_COMPARE
#
# Executes jekyll and generates the documentation
# The documentation will be generated in the directory "docs/_site".
#
function pmd_doc_generate_jekyll_site() {
pushd docs || { echo "Directory 'docs' doesn't exist"; exit 1; }
echo -e "\n\n"
pmd_ci_log_info "Building documentation using jekyll..."
bundle config set --local path vendor/bundle
bundle install
bundle exec jekyll build
popd || exit 1
}
#
# Creates the pmd-doc.zip archive. It will be placed in "docs/".
#
function pmd_doc_create_archive() {
pushd docs || { echo "Directory 'docs' doesn't exist"; exit 1; }
echo -e "\n\n"
pmd_ci_log_info "Creating pmd-doc archive..."
mv _site "pmd-doc-${PMD_CI_MAVEN_PROJECT_VERSION}"
zip -qr "pmd-doc-${PMD_CI_MAVEN_PROJECT_VERSION}.zip" "pmd-doc-${PMD_CI_MAVEN_PROJECT_VERSION}/"
pmd_ci_log_success "Successfully created pmd-doc-${PMD_CI_MAVEN_PROJECT_VERSION}.zip"
popd || exit 1
}
#
# Publishes the site to https://pmd.github.io/pmd-${PMD_CI_MAVEN_PROJECT_VERSION} and
# https://pmd.github.io/latest/
#
function publish_release_documentation_github() {
echo -e "\n\n"
pmd_ci_log_info "Adding the new doc to pmd.github.io..."
# clone pmd.github.io. Note: This uses the ssh key setup earlier
# In order to speed things up, we use a sparse checkout - no need to checkout all directories here
mkdir pmd.github.io
(
cd pmd.github.io || { echo "Directory 'pmd.github.io' doesn't exist"; exit 1; }
git init
git config user.name "PMD CI (pmd-bot)"
git config user.email "andreas.dangel+pmd-bot@adangel.org"
git config core.sparsecheckout true
git remote add origin git@github.com:pmd/pmd.github.io.git
echo "/latest/" > .git/info/sparse-checkout
echo "/sitemap.xml" >> .git/info/sparse-checkout
git pull --depth=1 origin master
pmd_ci_log_info "Copying documentation from ../docs/pmd-doc-${PMD_CI_MAVEN_PROJECT_VERSION}/ to pmd-${PMD_CI_MAVEN_PROJECT_VERSION}/ ..."
rsync -ah --stats "../docs/pmd-doc-${PMD_CI_MAVEN_PROJECT_VERSION}/" "pmd-${PMD_CI_MAVEN_PROJECT_VERSION}/"
git status
pmd_ci_log_debug "Executing: git add pmd-${PMD_CI_MAVEN_PROJECT_VERSION}"
git add "pmd-${PMD_CI_MAVEN_PROJECT_VERSION}"
pmd_ci_log_debug "Executing: git commit..."
git commit -q -m "Added pmd-${PMD_CI_MAVEN_PROJECT_VERSION}"
pmd_ci_log_info "Copying pmd-${PMD_CI_MAVEN_PROJECT_VERSION} to latest ..."
git rm -qr latest
cp -a "pmd-${PMD_CI_MAVEN_PROJECT_VERSION}" latest
pmd_ci_log_debug "Executing: git add latest"
git add latest
pmd_ci_log_debug "Executing: git commit..."
git commit -q -m "Copying pmd-${PMD_CI_MAVEN_PROJECT_VERSION} to latest"
pmd_ci_log_info "Generating sitemap.xml"
../docs/sitemap_generator.sh > sitemap.xml
pmd_ci_log_debug "Executing: git add sitemap.xml"
git add sitemap.xml
pmd_ci_log_debug "Executing: git commit..."
git commit -q -m "Generated sitemap.xml"
pmd_ci_log_info "Executing: git push origin master"
git push origin master
)
}
#
# Updates github pages of the main repository,
# so that https://pmd.github.io/pmd/ has the latest (snapshot) content
#
function pmd_doc_publish_to_github_pages() {
echo -e "\n\n"
pmd_ci_log_info "Pushing the new site to github pages..."
git clone --branch gh-pages --depth 1 git@github.com:pmd/pmd.git pmd-gh-pages
# clear the files first
rm -rf pmd-gh-pages/*
# copy the new site
cp -a "docs/pmd-doc-${PMD_CI_MAVEN_PROJECT_VERSION}"/* pmd-gh-pages/
(
cd pmd-gh-pages || { echo "Directory 'pmd-gh-pages' doesn't exist"; exit 1; }
git config user.name "PMD CI (pmd-bot)"
git config user.email "andreas.dangel+pmd-bot@adangel.org"
git add -A
MSG="Update documentation
${PMD_CI_JOB_URL}
${PMD_CI_PUSH_COMMIT_COMPARE}"
git commit -q -m "$MSG"
git push git@github.com:pmd/pmd.git HEAD:gh-pages
pmd_ci_log_success "Successfully pushed site to https://pmd.github.io/pmd/"
)
}
+90
View File
@@ -0,0 +1,90 @@
#!/usr/bin/env bash
MODULE="pmd-doc"
SCRIPT_INCLUDES="log.bash openjdk.bash"
# shellcheck source=inc/fetch_ci_scripts.bash
source "$(dirname "$0")/inc/fetch_ci_scripts.bash" && fetch_ci_scripts
#
# The functions here require the following environment variables:
# PMD_CI_BRANCH
#
# DANGER_GITHUB_API_TOKEN
# PMD_CI_CHUNK_TOKEN
function regression_tester_setup_ci() {
pmd_ci_log_info "Install openjdk8 for pmd-regression-tests"
pmd_ci_openjdk_install_adoptopenjdk 8
gpg --batch --yes --decrypt --passphrase="GnxdjywUEPveyCD1RLiTd7t8CImnefYr" \
--output .ci/files/public-env .ci/files/public-env.gpg
# shellcheck disable=SC1091
source .ci/files/public-env >/dev/null 2>&1
rm .ci/files/public-env
if hash "bundler" 2>/dev/null; then
pmd_ci_log_debug "Bundler is already installed"
else
pmd_ci_log_info "Installing bundler..."
gem install bundler
fi
rm -f .bundle/config
bundle config set --local path vendor/bundle
bundle config set --local with release_notes_preprocessing
bundle install
}
#
# Generate a new baseline and upload it to pmd-code.org
#
function regression_tester_uploadBaseline() {
local pmdcodeUrl="https://pmd-code.org/pmd-regression-tester/"
local baseline_branch="${PMD_CI_BRANCH:-$PMD_CI_TAG}"
pmd_ci_log_debug "${FUNCNAME[0]} branch=${baseline_branch}"
pmd_ci_log_info "Generating and uploading baseline for pmdtester (${baseline_branch})..."
pushd ..
rm -f .bundle/config
bundle config set --local gemfile pmd/Gemfile
bundle exec pmdtester \
--mode single \
--local-git-repo ./pmd \
--patch-branch "${baseline_branch}" \
--patch-config ./pmd/.ci/files/all-java.xml \
--list-of-project ./pmd/.ci/files/project-list.xml --html-flag \
--error-recovery
pushd target/reports || { echo "Directory 'target/reports' doesn't exist"; exit 1; }
BRANCH_FILENAME="${baseline_branch/\//_}"
zip -q -r "${BRANCH_FILENAME}-baseline.zip" "${BRANCH_FILENAME}/"
# ssh-key for pmd-code.org is setup already by pmd_ci_setup_secrets_ssh
scp "${BRANCH_FILENAME}-baseline.zip" pmd@pmd-code.org:/httpdocs/pmd-regression-tester/
pmd_ci_log_success "Successfully uploaded ${BRANCH_FILENAME}-baseline.zip to ${pmdcodeUrl}"
popd || exit 1
popd || exit 1
}
#
# Execute danger, which executes pmd-regression-tester (via Dangerfile).
#
function regression_tester_executeDanger() {
pmd_ci_log_debug "${FUNCNAME[0]}"
# Create a corresponding remote branch locally
if ! git show-ref --verify --quiet "refs/heads/${PMD_CI_BRANCH}"; then
git fetch --no-tags --depth=1 origin "+refs/heads/${PMD_CI_BRANCH}:refs/remotes/origin/${PMD_CI_BRANCH}"
git branch "${PMD_CI_BRANCH}" "origin/${PMD_CI_BRANCH}"
pmd_ci_log_debug "Created local branch ${PMD_CI_BRANCH}"
fi
# Fetch more commits of the PR for danger and regression tester
git fetch --no-tags --depth=50 origin "+$(git rev-parse HEAD^2):"
# Fetch more commits from master branch for regression tester
if [[ "${PMD_CI_BRANCH}" != "master" ]]; then
git fetch --no-tags --depth=50 origin +master:
git branch master origin/master
fi
pmd_ci_log_info "Running danger on branch ${PMD_CI_BRANCH}"
bundle exec danger --verbose
pmd_ci_log_success "Executed danger successfully"
}
+5
View File
@@ -0,0 +1,5 @@
#
# https://docs.github.com/en/github/administering-a-repository/displaying-a-sponsor-button-in-your-repository
#
github: pmd
open_collective: pmd
@@ -0,0 +1,30 @@
---
name: Rule violation (false-positive)
about: Let us know about a false-positive (a violation is reported on code that is not problematic)
title: ''
labels: 'a:false-positive'
assignees: ''
---
<!-- Please, prefix the report title with the language it applies to within brackets, such as [java] or [apex] -->
**Affects PMD Version:**
**Rule:**
Please provide the rule name and a link to the rule documentation:
<https://pmd.github.io/latest/pmd_rules_XXX_XXX.html#XXX>
**Description:**
**Code Sample demonstrating the issue:**
```
```
**Expected outcome:**
PMD reports a violation at line ..., but that's wrong. That's a false positive.
**Running PMD through:** *[CLI | Ant | Maven | Gradle | Designer | Other]*
@@ -0,0 +1,30 @@
---
name: Rule violation (false-negative)
about: Let us know about a false-negative (no violation is reported on problematic code)
title: ''
labels: 'a:false-negative'
assignees: ''
---
<!-- Please, prefix the report title with the language it applies to within brackets, such as [java] or [apex] -->
**Affects PMD Version:**
**Rule:**
Please provide the rule name and a link to the rule documentation:
<https://pmd.github.io/latest/pmd_rules_XXX_XXX.html#XXX>
**Description:**
**Code Sample demonstrating the issue:**
```
```
**Expected outcome:**
PMD should report a violation at line ..., but doesn't. This is a false-negative.
**Running PMD through:** *[CLI | Ant | Maven | Gradle | Designer | Other]*
+27
View File
@@ -0,0 +1,27 @@
---
name: New Rule
about: You have an idea for a new rule? Great!
title: ''
labels: 'a:new-rule'
assignees: ''
---
<!-- Please, prefix the report title with the language it applies to within brackets, such as [java] or [apex] -->
**Proposed Rule Name:**
**Proposed Category:** One of [Best Practices | Code Style | Design | Documentation | Error Prone | Multithreading | Performance | Security]
**Description:**
**Code Sample:** This should include code, that should be flagged by the rule. If possible, the "correct" code
according to this new rule should also be demonstrated.
```
```
**Possible Properties:**
* Should this rule be customizable via properties?
@@ -0,0 +1,20 @@
---
name: Feature request
about: Suggest an idea for this project
title: ''
labels: 'an:enhancement'
assignees: ''
---
**Is your feature request related to a problem? Please describe.**
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]
**Describe the solution you'd like**
A clear and concise description of what you want to happen.
**Describe alternatives you've considered**
A clear and concise description of any alternative solutions or features you've considered.
**Additional context**
Add any other context about the feature request here.
@@ -1,20 +1,41 @@
---
name: Bug report
about: Create a report to help us improve
title: ''
labels: 'a:bug'
assignees: ''
---
<!-- Please, prefix the report title with the language it applies to within brackets, such as [java] or [apex].
If not specific to a language, you can use [core]. -->
<!-- NB: issues about the rule designer should be opened at https://github.com/pmd/pmd-designer/issues -->
**Affects PMD Version:**
**Rule:**
Make sure, to test with the latest PMD version.
**Description:**
A clear and concise description of what the bug is.
**Exception Stacktrace:**
```
# Copy-paste the stack trace here
```
**Code Sample demonstrating the issue:**
```
```
**Steps to reproduce:**
Please provide detailed steps for how we can reproduce the bug.
1. ... (e.g. if you're using maven: `mvn clean verify`)
2. ...
**Running PMD through:** *[CLI | Ant | Maven | Gradle | Designer | Other]*
<!-- If relevant, also include your JDK and OS information, e.g. for ClassNotFoundException, LinkageError, reflection failures, etc. -->
+11
View File
@@ -0,0 +1,11 @@
blank_issues_enabled: false
contact_links:
- name: Question
url: https://github.com/pmd/pmd/discussions?discussions_q=category%3AQ%26A
about: Feel free to ask any question about PMD and its usage
- name: PMD Designer Issues
url: https://github.com/pmd/pmd-designer/issues
about: Issues about the rule designer
- name: PMD Eclipse Plugin Issues
url: https://github.com/pmd/pmd-eclipse-plugin/issues
about: Issues about the PMD Eclipse Plugin
+16 -7
View File
@@ -1,10 +1,19 @@
<!--
Please, prefix the PR title with the language it applies to within brackets, such as *[java]* or *[apex]*. If not specific to a language, you can use *[core]*
-->
## Describe the PR
Before submitting a PR, please check that:
- [ ] The PR is submitted against `master`. The PMD team will merge back to support branches as needed.
- [ ] `./mvnw clean verify` passes. This will [build](https://github.com/pmd/pmd/blob/master/BUILDING.md) and test PMD, execute PMD and checkstyle rules. [Check this for more info](https://github.com/pmd/pmd/blob/master/CONTRIBUTING.md#code-style)
<!-- A clear and concise description of the bug the PR fixes or the feature the PR introduces. -->
**PR Description:**
## Related issues
<!-- PR relates to issues in the `pmd` repo: -->
- Fixes #
## Ready?
<!-- If you feel like you can help to check off the following tasks, that'd be great. If not, don't worry - we will take care of it. -->
- [ ] Added unit tests for fixed bug/feature
- [ ] Passing all unit tests
- [ ] Complete build `./mvnw clean verify` passes (checked automatically by github actions)
- [ ] Added (in-code) documentation (if needed)
+13
View File
@@ -0,0 +1,13 @@
version: 2
updates:
- package-ecosystem: "maven"
directory: "/"
schedule:
interval: "weekly"
target-branch: "master"
open-pull-requests-limit: 0
- package-ecosystem: "github-actions"
directory: "/"
schedule:
interval: "weekly"
target-branch: "master"
+62
View File
@@ -0,0 +1,62 @@
name: build
on:
push:
branches:
- main
- master
tags:
- '**'
pull_request:
schedule:
# build it monthly: At 04:00 on day-of-month 1.
- cron: '0 4 1 * *'
workflow_dispatch:
jobs:
build:
runs-on: ${{ matrix.os }}
continue-on-error: false
strategy:
matrix:
os: [ ubuntu-latest, windows-latest, macos-latest ]
if: ${{ !contains(github.event.head_commit.message, '[skip ci]') }}
steps:
- uses: actions/checkout@v2
with:
fetch-depth: 2
- uses: actions/cache@v2
with:
path: |
~/.m2/repository
~/.gradle/caches
~/.cache
~/work/pmd/target/repositories
vendor/bundle
key: v1-${{ runner.os }}-${{ hashFiles('**/pom.xml') }}
restore-keys: |
v1-${{ runner.os }}-
- name: Set up Ruby 2.7
uses: ruby/setup-ruby@v1
with:
ruby-version: 2.7
- name: Setup Environment
shell: bash
run: |
echo "LANG=en_US.UTF-8" >> $GITHUB_ENV
echo "MAVEN_OPTS=-Dmaven.wagon.httpconnectionManager.ttlSeconds=180 -Dmaven.wagon.http.retryHandler.count=3 -DautoReleaseAfterClose=true -DstagingProgressTimeoutMinutes=30" >> $GITHUB_ENV
echo "PMD_CI_SCRIPTS_URL=https://raw.githubusercontent.com/pmd/build-tools/13/scripts" >> $GITHUB_ENV
- name: Check Environment
shell: bash
run: |
f=check-environment.sh; \
mkdir -p .ci && \
( [ -e .ci/$f ] || curl -sSL "${PMD_CI_SCRIPTS_URL}/$f" > ".ci/$f" ) && \
chmod 755 .ci/$f && \
.ci/$f
- name: Build
run: .ci/build.sh
shell: bash
env:
PMD_CI_SECRET_PASSPHRASE: ${{ secrets.PMD_CI_SECRET_PASSPHRASE }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
+29
View File
@@ -0,0 +1,29 @@
name: git-repo-sync
on:
push:
branches:
- main
- master
tags:
- '**'
workflow_dispatch:
jobs:
build:
runs-on: ubuntu-latest
continue-on-error: false
steps:
- uses: actions/checkout@v2
with:
fetch-depth: 100
- name: Setup Environment
shell: bash
run: |
echo "LANG=en_US.UTF-8" >> $GITHUB_ENV
echo "PMD_CI_SCRIPTS_URL=https://raw.githubusercontent.com/pmd/build-tools/12/scripts" >> $GITHUB_ENV
- name: Sync
run: .ci/git-repo-sync.sh
shell: bash
env:
PMD_CI_SECRET_PASSPHRASE: ${{ secrets.PMD_CI_SECRET_PASSPHRASE }}
+55
View File
@@ -0,0 +1,55 @@
name: troubleshooting
on: workflow_dispatch
jobs:
build:
runs-on: ${{ matrix.os }}
continue-on-error: false
strategy:
matrix:
#os: [ ubuntu-latest, windows-latest, macos-latest ]
os: [ ubuntu-latest ]
steps:
- uses: actions/checkout@v2
- uses: actions/cache@v2
with:
path: |
~/.m2/repository
~/.gradle/caches
~/.cache
~/work/pmd/target/repositories
vendor/bundle
key: v1-${{ runner.os }}-${{ hashFiles('**/pom.xml') }}
restore-keys: |
v1-${{ runner.os }}-
- name: Set up Ruby 2.7
uses: ruby/setup-ruby@v1
with:
ruby-version: 2.7
- name: Setup Environment
shell: bash
run: |
echo "LANG=en_US.UTF-8" >> $GITHUB_ENV
echo "MAVEN_OPTS=-Dmaven.wagon.httpconnectionManager.ttlSeconds=180 -Dmaven.wagon.http.retryHandler.count=3 -DstagingProgressTimeoutMinutes=30" >> $GITHUB_ENV
echo "PMD_CI_SCRIPTS_URL=https://raw.githubusercontent.com/pmd/build-tools/13/scripts" >> $GITHUB_ENV
- name: Check Environment
shell: bash
run: |
f=check-environment.sh; \
mkdir -p .ci && \
( [ -e .ci/$f ] || curl -sSL "${PMD_CI_SCRIPTS_URL}/$f" > ".ci/$f" ) && \
chmod 755 .ci/$f && \
.ci/$f
- name: Build
run: |
f=openjdk.bash; \
mkdir -p .ci/inc && \
( [ -e .ci/inc/$f ] || curl -sSL "${PMD_CI_SCRIPTS_URL}/inc/$f" > ".ci/inc/$f" ) && \
source .ci/inc/$f ; \
pmd_ci_openjdk_install_adoptopenjdk 11 ; \
pmd_ci_openjdk_setdefault 11
shell: bash
- name: Setup tmate session
uses: mxschmitt/action-tmate@v3
+1
View File
@@ -14,6 +14,7 @@ bin/
pmd-core/dependency-reduced-pom.xml
.bundle
vendor
.DS_Store
# rule docs are generated
docs/pages/pmd/rules
+1 -1
View File
@@ -1,2 +1,2 @@
distributionUrl=https://repo.maven.apache.org/maven2/org/apache/maven/apache-maven/3.6.3/apache-maven-3.6.3-bin.zip
distributionUrl=https://repo.maven.apache.org/maven2/org/apache/maven/apache-maven/3.8.1/apache-maven-3.8.1-bin.zip
wrapperUrl=https://repo.maven.apache.org/maven2/io/takari/maven-wrapper/0.5.6/maven-wrapper-0.5.6.jar
-101
View File
@@ -1,101 +0,0 @@
language: java
os: linux
env:
global:
- secure: "KBEuB6U1p5RQXSYe157AwydFr/zpXQPA0IChVCgZV+X1mMyy9ZtrjH1J1AXuviseDDXDbaT25sRnsvpl82rfRw2xOkMGXHy4N95/ylTSr8DjHxTao71BhXsvFycNobFva5y2EGNWqDvpS8I2oSZo7Qk4la3yep3rcJQvcy6RDbbhpDTbL1QMFyadunIBm0WtqbunrMqtjSqaoPsXz8TiQuxHvX4vEXzVbaxV1QQt79Vi+daa6wAV3mRQAugnx+UffsC8JqMxgm06usWeJgCJzxgm8E7clZCLmf53B2TL8dK6bIYbqyvOY3uFxitsTG0d8Z0GOJwXBgZNgbniTRO8ZJSty5eZP8LBybbjVLSL25DNTWtCjADUL/uySnXIEidlMt2N/3QmH7zrGAfAk/tIwKpdRca2GLLydeXf6PSkiahnPEkIY/QupcsOLELhdifpdOjb8QW1OenA+vUbNM9dccLwKnX6Fj9cu4VQG601AcYDr2eyhq8WYkr3wYdw/6KdUa3hmplowTBs+qguppP+eOSgGuEsy38KLtqnvm6WlHy6tcLmcVYKG3DmR1b7TWXsOXC6/VMH8BHBkvsF1QdRg9+Cgx07vX3Hw7roPiYzmaO9Ajs20ATsUfRskMuWCTeTSK5pN8X27veRCZlhFjeKQMDdmfVwzpAfRgKsl3TEn1I="
- secure: "U1DfAv6acUUWe+dao/ZSDUX64JRadNJY16rITsdrM4ZNAJSuXpEY3p/LWcYjN7D49YmyutbXH9+L3KKQUQGrGXj9QTarfYvd8ZsKt4FK8yv7AFy+RQNIbAjNEHBzHx15p+srMheTaetl7aLwY0qhF+D/RtGapxHKyY4dBHrb0lp8VGyiCiL7Aop8GGskosi1mtirPBp/BStPZ2bEyxG0QzU5SsVWkJWwV9aWLPVAR/n7Xgx/6Gjl6Fed2c/WSrWi4vchm3Ny8pfTweOax3PGYYjBVxIfuX0mqmwuJsY7gNfXCfN3dPiPKGJPFy1pC+LGyGkklO5ReKFLd4O1ME6fU0dlIGfD6n+Q4H6/w9FHXegcKTfWIJm/MFa6vA/tJM5R6zJQuiTQJboHm/UmS/iQj76z0p6sK15Xp5vFId+/dHKqa8xY+Bt6HiXy6z401HOc8QcYBAf7TqhqUt/ZE7HN4be46uR90KmzIrWz6wEoDW7HfwQ9ZMbs55zoOXrvekyE9/gXskypO0p2JT3Y0vlvO27KQvIrSwI480kOVOrlyrYA+LZqlcKaayOuCuZh4lITQUYinUoZZict5joYthH+Cyh2zovoBpxsntDJdMnaZNLtSC7hlhpbMBYaT2y1O6vZH5Yix0mxuDvs/x6ogP5CNBeUYlXhaL+g4GnwKyr0ZA0="
- secure: "gxI7W4V4fUPQLMCvecXXdet1/mCh6m0RIQMtErVVOnwxEEjeDmko/3rHSl+wk6IeFaaQKcmHJJSJEj+e5TgWRH1uuzCnbFHZhuH28ce/H0EqLJ3GTXeDEgFLzhh//T3ySOZChZELgJ67cKxZJNFMhBVOR2/QIGjZjdzvl36ugsu80Ak3XJb8HCm8D2P8Vuezz/OlCkSOGXaiqZXfflV/cuaLWuueGfQGW9x/UyDTNsuBdB7YnEcxOWt8RgB4JrcPGV7/etxLHXTw9IMEeUhQ/RsxLZHKNYt9cx/QOZkpXemhdT9L2pAIi77eO98x+yAfB1qV6T6IeDd/OiABUzfb7asNBwE+bYRuVkCiWLo3x3hs8FcgsPe4L10guxfRMJPxax9E7uYb9TFxtvc42dDWNyp1BVCtEtmjErO4CJeW97ukhgkUkPhzUZgQ2Gj5Tn4VRjQOQyzh/S/YsHyfxoAQrscc/3bq5PBmtdowyGQd5dsvShdpE6glf+HnBZ8TCw5BaxQuTjapQWjsGuJVCVsrNDtwOFy5UTfxK9OeTUsjwfO5JjkoIeqGyLHPnTMWyZ6EYa//nWPOU1KgVE6Hrzfr3zxEzL1nN/TYahzhKOxXE701W9YhTmhCVljMlSYioTUfTaXHgGLpojvSWlhsTbc3r0gj4NglqakIy7MKgQLgES8="
- secure: "otZkFNhApMofp2Jl2baZdpNEPcTa79Xc9wyOw1gl1+ubCLtOGr32FDUSr0HQWKrGXcYZR4bc0A80hx0/ykZ/twJaRAabcNYtjwRMDKKrp3plvp8RTZlB1QW85nsdmk3qmHACzc94wKnmcaDohM5FPxnWspZG5Y4ejYX4HEK6r1fwL4FjMPSLd5QW8yCaAc7dpBSm2UyIXuuDjkekXblJFe8ydbf9aF97WKJMCwqIs9Zo5oJa2pnWCw47ixwjVdkaH5x5727I+YmFqn5rjdEideUFEAlggqMaxuOtfYhuG/8k5W3Q/+WX+G7rEPTcemjmaosbbpoOUE0YUHV3Wi3R5D66NuWIpQwX6kw4rTwL0YIh//0aNb8jv4Z8KwkiTMrYuj0we5tXzARp3yYn56P0JBAm6BihNhfEBv06655Tg5LUsWqUTZCl3KJhwtO1N+OuOkE5qoZm59knq6DeZOsYWAVb3MpzklP06kXGYTjb44PVMUc6ynuuZjgPJDv/0906feA3REHBJVxd3PvJp1c8VvQSeW3ndghEz0akJHY/jxV1rJZAZC1ZeshYUpBNmh0sFDty/UE43IvIB4EInypQHyTtQvMc6LuLjTeu2E5ZMsA3udj66EMrYm4Y2eheJycSfttDqzhsKXIVJ4LmA/xtDR01cp1jsqbbZBhVI67rA40="
- secure: "mmHRnK/8CHfgtwaTN3MgjFD1R8EVQhIb/a0Aag3gPaHWW52Ex6xWG7GsF4kRcdzHdIdrQxHZTiDa2oVMWbnQ16CAu4dZJadwTxhBW4JmE1tsi2C6i+uwMBPvnKBXHwt+QOAqNB0L/ByYwWLkucSLoyRs6qU0i7sJ3ZC/EPCuLI8VfBlFUVegSbp2WmclmFnxOi5MKr15Zwd8BGgyWUsvd1OHxhvO3Xr/ZPO4R+1kIgyojloTMu6oGM/shYgsrUXgmI/WvZRTq+25SRCjUmATJtuDXXgVeJtYabi/+Zju5Z7K06oaKvFYM+BgZWPmGQkVCxKVjSlug0rx6+qgRKIf/B/cPxmQDS0ZZVDmDcbxeibBL9JhRqIDwDb0XS9t1qBXvIJ5E4ZmdX/XuvLCnC4xJptu/vHyKl1wbRM3dcXEBk8J0knJc4JvY2yupF3LS32sfEHftLwzr63U3/0dOQvsCSJRBy5zgI8ieABUZAeZmmaQ6RCGOTEYrGO2G4CCF2uVq4YdrCOsfmrb0DzH8llNMkXKzXlITRvmkuBlTRRKxGnPzS3vf0iicdAkmTiU5u7lArFFc7IKcW4ypO+RKDTUpq74K+UZBI9eBjV7Po368EO8epJ5aIx32a2kyS/hYWkS/dZh7I0fNZa2qBUceZO/KZGRjH4dQFW9t0J9Q7LLXJY="
- secure: "B2quYqla3mqu3QHqeRGMde66IFAluUHhzY87q/giPvONm/V7xmIcxzC6JNQ7X4pHotC7MUbsMf7vdcL1tyuPP5nqyfaxk0nnGnVoJZIQhMaBQ6Lkyt2Ac5u5/QBeHujrj8gqGjT7vzgPIYMYiSLV09VcPgMaYS6WxCrFmXOEJOeVGOGjG9J2wApAmlf6m/hBogLEbdbzRheqJwX5gMxppKX5XRaiqvKGR7hHFiW5HBaAiQ6caQEw6DZL9GnjMsqd5VMVL7DmbETncNE1utLVDO7mFwDMbkeonmwjsmQsJAo5Be+WFl/a/yRQLrqhhTFwag+V7g7RjcBKAdJ5IZJkN0EC9GjY0ZGOjE2cmcrX03U1g1voO7oreH6+25VqPTTGWHv5K8wDWM5QnhBJGtH2yH76p5XYK8iNOXPTqvjubN9sG3INsnTjxBHuQw+aY2vgwBGCvW+Asqe73BV8SDrmqcCqgmm/BUy0kZRd8mhaQdFL0SAO3suV7uf+fzIsmRtndFx24J5Cm6LE6NnTmtbhHhs4mUEqfngMq0XZBXj5z4LDhzOH4g3rf/Y7jHBjAAa6sKeh1sINdHrMdB843dDfNQPp/7g3hfKi31U9ZMczndsr2QYqm2OC/3lPiRHC+8Grj5PxXmiBplzTppyhl+1pjZWy5SCoQi6ulBOyaZcwfYM="
- secure: "Kmh31kozw9NBbwtkucpf+QslinJIclB7rcktHz4RokVS5xiMD7njWvD8ptZhXqZG/tNcNiXkWskgM9EV/OvLTTavJToHE1gMhJel5ODxKM0b5QZDy6tkW/wI0Kdl0lck90EAJ7bmsOmF+oGczGsauiLPSlBOZV0tn1zdeJKwwmg46C9UyIhTDcFqUD1ehxExkDHnbOk6HmEPGCsZQCGNXY2t++dO7fRodIgjZAKcyTwgrh6WEZDfQDjvC51yQlVzL2mrcFqHi8qYAx3OHnuidRoMZ4huaoxLimw/1bGii/txTZwJ/pQdF90kGqSqLpRiO2lHLq5l8WAd4Z1XPSs1ZzbKUEhWO8VGgfR0Cp+Bkkd6P/vcuTq7bdhpvdnZn9FRUI/bfgZi827Skj/WoUh0RR7ns6RuDfQ5uGD9NiWDsbfoKLbvvYjyQycQlQTKglYQVcU/pWsuqVlx+27vM6JltR0Pct4uAJxAN+EFA4sTT/u4HiZ0NQyZWisZauu7CyMRN29fkKVVyYHHCr6QcNMUpvp1vvKYaUN7GeykGNVfoHB7CWAKcc6banh33c+QqG5DSTE++ZNa712gxEizQnO5MmLECUxNDpOGZnLsTlgbABwDxxe4PxFxXvBLm9pkJftq5cp9T9Syzz/yyT7z5weSGvRes94eUtSt0agoeX2MKsE="
- secure: "VezxV+VdmbmtrQYT8AZIyg41WBROxuxpumerkcubADF7V4wV6lwx9Rd2G6yAr0VuHCNUUhS4m+gPFIsuiQbAhyupiEkwhzUYqk1tF+LITlLLPegLypjiLmhJMwGUNuDSSsih1Icmg9FzrP4VyzgGn9pBjoG9QYj1civBZeGwg++e/XDYlHMXrpd/UEfMKVB71JwB0tle4fKJZSvblIqP62yvbBaKHx6A4+ZWzJV5Vps0DoIeNtKCNmNNloKZVHfjbsvqSjnMYUJzkOzyPkM822q41N/D+3IAufO16+jH/W0vAZeN0e4GXiN5W+CVkr2Gbh0FwkVQcI3bekaOIn45XLUMLKdf+JsWDPKz9RraHelR9YxL5GoJ7ntwvmucxw0p8EVyJ/xLk/pBCP8iHq0Jb8//js25XHgxzzAWI37MErPAAGgTKZAVdAN0mGXbe63tWmwaBlEbK8h2A8di6abW5x6YHTkTo2BRlHUSTU8dE3VqTnpSkne5n1SlEa4g1Bci3J45M0/pLmHV6yCxCM5BrVXS5ByaB61py/umSbpmdIBFV6TM1MaKK3lAucQrR+8To/vCbm8XqPyujJdOR+ENIuuDgEU/Yh5Hv5SAODekUYaCp4pjfGzFADHQWVNDxIOXrwBN4OfSiAvRc1x6HXndOmNI4QtOxheuCRFFthq8VZI="
- GITHUB_BASE_URL=https://api.github.com/repos/pmd/pmd
jobs:
fast_finish: true
include:
- stage: build
name: "linux - mvn deploy"
os: linux
dist: bionic
env: BUILD=deploy
- name: "linux - build documentation"
os: linux
dist: bionic
env: BUILD=doc
- name: "linux - run sonar"
os: linux
dist: bionic
env: BUILD=sonar
if: "type = push && repo = pmd/pmd && fork = false"
- name: "linux - run coveralls"
os: linux
dist: bionic
env: BUILD=coveralls
if: "type = push && repo = pmd/pmd && fork = false"
- name: "macosx - mvn verify"
os: osx
env: BUILD=deploy
- name: "windows - mvn verify"
os: windows
env: BUILD=deploy
language: shell
- stage: publish
name: "Release Build - Publish"
os: linux
dist: bionic
if: "type = push && repo = pmd/pmd && fork = false && tag is present"
env: BUILD=publish
before_install:
- bash .travis/before_install.sh "11.0.6+10"
- source ${HOME}/java.env
install: true
before_script: true
script: source .travis/build-$BUILD.sh
after_success: true
notifications:
webhooks:
urls:
- https://webhooks.gitter.im/e/0e6dd310db54b96c2653
- https://webhooks.gitter.im/e/65efc1ea65175ad23ab6
on_success: always # options: [always|never|change] default: always
on_failure: always # options: [always|never|change] default: always
on_start: never # options: [always|never|change] default: always
email:
recipients:
- andreas.dangel@adangel.org
on_success: change
on_failure: always
cache:
directories:
- "$HOME/.m2"
- "$HOME/.cache"
- vendor/bundle
- "$HOME/.rvm/"
# Secure Keys, that need to be set for snapshot builds
#
# CI_DEPLOY_USERNAME - the user which can upload net.sourceforge.pmd:* to https://oss.sonatype.org/
# CI_DEPLOY_PASSWORD
#
# SONAR_TOKEN - the token used to update https://sonarqube.com/dashboard/?id=393826
#
# PMD_SF_USER - the sourceforge user, which is used to upload created binaries to sf files section. Note: an ssh key is
# required. See "before_install".
#
# Secure Keys, that need to be set for releases:
#
# PMD_SF_APIKEY - used to make the new release the default file in the files section. See https://sourceforge.net/auth/preferences/
# under "Release API Key"
#
# CI_SIGN_KEYNAME
# CI_SIGN_PASSPHRASE
# add the encrypted GPG keyring file to repo (https://docs.travis-ci.com/user/encrypting-files/#Automated-Encryption), decrypt it and install it at the beginning of .travis-deploy.sh
#
# GITHUB_OAUTH_TOKEN - the token used to upload the binaries to github releases
# GITHUB_BASE_URL - the api url to use for github releases - does not need to be secure (https://api.github.com/repos/pmd/pmd)
#
-22
View File
@@ -1,22 +0,0 @@
#!/bin/bash
set -e
source .travis/logger.sh
source .travis/common-functions.sh
travis_debug
OPENJDK_VERSION=$1
bash .travis/setup-secrets.sh
bash .travis/configure-maven.sh
bash .travis/install-openjdk.sh $OPENJDK_VERSION
if travis_isLinux; then
gem install bundler
bundle install --with=release_notes_preprocessing --path=vendor/bundle
else
log_info "Not setting up ruby for ${TRAVIS_OS_NAME}."
exit 0
fi
-28
View File
@@ -1,28 +0,0 @@
#!/bin/bash
set -e
source .travis/logger.sh
source .travis/common-functions.sh
VERSION=$(./mvnw -q -Dexec.executable="echo" -Dexec.args='${project.version}' --non-recursive org.codehaus.mojo:exec-maven-plugin:1.5.0:exec)
log_info "Building PMD Coveralls.io report ${VERSION} on branch ${TRAVIS_BRANCH}"
if ! travis_isPush; then
echo "Not proceeding, since this is not a push!"
exit 0
fi
(
# disable fast fail, exit immediately, in this subshell
set +e
./mvnw clean install -DskipTests=true -Dmaven.javadoc.skip=true -B -V
./mvnw package jacoco:report coveralls:report -Pcoveralls -B -V
if [ $? -ne 0 ]; then
log_error "Error creating coveralls report"
else
log_success "New coveralls result: https://coveralls.io/github/pmd/pmd"
fi
true
)
-78
View File
@@ -1,78 +0,0 @@
#!/bin/bash
set -e
source .travis/logger.sh
source .travis/common-functions.sh
source .travis/github-releases-api.sh
source .travis/sourceforge-api.sh
source .travis/regression-tester.sh
VERSION=$(./mvnw -q -Dexec.executable="echo" -Dexec.args='${project.version}' --non-recursive org.codehaus.mojo:exec-maven-plugin:1.5.0:exec)
log_info "Building PMD ${VERSION} on branch ${TRAVIS_BRANCH}"
MVN_BUILD_FLAGS="-B -V"
if travis_isOSX; then
log_info "The build is running on OSX"
./mvnw verify $MVN_BUILD_FLAGS
elif travis_isWindows; then
log_info "The build is running on Windows"
./mvnw verify $MVN_BUILD_FLAGS
elif travis_isPullRequest; then
log_info "This is a pull-request build"
./mvnw verify $MVN_BUILD_FLAGS
regression-tester_executeDanger
elif travis_isPush; then
if [[ "${VERSION}" != *-SNAPSHOT && "${TRAVIS_TAG}" != "" ]]; then
echo -e "\n\n"
log_info "This is a release build for tag ${TRAVIS_TAG}"
echo -e "\n\n"
# create a draft github release
gh_releases_createDraftRelease "${TRAVIS_TAG}" "$(git rev-list -n 1 ${TRAVIS_TAG})"
GH_RELEASE="$RESULT"
# Build and deploy to ossrh / maven-central
./mvnw deploy -Possrh,sign,pmd-release $MVN_BUILD_FLAGS
echo -e "\n\n"
# Deploy to github releases
gh_release_uploadAsset "$GH_RELEASE" "pmd-dist/target/pmd-bin-${VERSION}.zip"
gh_release_uploadAsset "$GH_RELEASE" "pmd-dist/target/pmd-src-${VERSION}.zip"
# Deploy to sourceforge files
sourceforge_uploadFile "${VERSION}" "pmd-dist/target/pmd-bin-${VERSION}.zip"
sourceforge_uploadFile "${VERSION}" "pmd-dist/target/pmd-src-${VERSION}.zip"
regression-tester_uploadBaseline
elif [[ "${VERSION}" == *-SNAPSHOT ]]; then
log_info "This is a snapshot build"
./mvnw deploy -Possrh,sign $MVN_BUILD_FLAGS
# Deploy to sourceforge files
sourceforge_uploadFile "${VERSION}" "pmd-dist/target/pmd-bin-${VERSION}.zip"
sourceforge_uploadFile "${VERSION}" "pmd-dist/target/pmd-src-${VERSION}.zip"
regression-tester_uploadBaseline
else
# other build. Can happen during release: the commit with a non snapshot version is built, but not from the tag.
log_info "This is some other build, probably during release: commit with a non-snapshot version on branch master..."
./mvnw verify $MVN_BUILD_FLAGS
# we stop here - no need to execute further steps
exit 0
fi
else
log_info "This is neither a pull request nor a push. Not executing any build."
exit 1
fi
-170
View File
@@ -1,170 +0,0 @@
#!/bin/bash
set -e
source .travis/logger.sh
source .travis/common-functions.sh
source .travis/github-releases-api.sh
source .travis/sourceforge-api.sh
function main() {
VERSION=$(./mvnw -q -Dexec.executable="echo" -Dexec.args='${project.version}' --non-recursive org.codehaus.mojo:exec-maven-plugin:1.5.0:exec)
log_info "Building PMD Documentation ${VERSION} on branch ${TRAVIS_BRANCH}"
#
# First step: build pmd with profile "generate-rule-docs"
# The docs should appear under "docs/pages/rules/..." for each language
# With this profile, also the checks are executed (e.g. DeadLinksChecker).
#
./mvnw clean verify -Dmaven.test.skip=true -Dmaven.javadoc.skip=true -P generate-rule-docs
if ! travis_isPush; then
log_info "Not publishing site, since this is not a push!"
exit 0
fi
#
# For pushes, we'll update the online documentation
#
generate_jekyll_doc
create_pmd-doc_archive
# Deploy to sourceforge files
sourceforge_uploadFile "${VERSION}" "docs/pmd-doc-${VERSION}.zip"
if [[ "${VERSION}" == *-SNAPSHOT && "${TRAVIS_BRANCH}" == "master" ]]; then
# only for snapshot builds from branch master
# update github pages https://pmd.github.io/pmd/
publish_to_github_pages
# rsync site to https://pmd.sourceforge.io/snapshot
sourceforge_rsyncSnapshotDocumentation "${VERSION}" "snapshot"
fi
if [[ "${VERSION}" != *-SNAPSHOT && "${TRAVIS_TAG}" != "" ]]; then
log_info "This is a release documentation build for pmd ${VERSION}"
# Deploy to github releases
gh_releases_getLatestDraftRelease
GH_RELEASE="$RESULT"
gh_release_uploadAsset "$GH_RELEASE" "docs/pmd-doc-${VERSION}.zip"
# updating github release text
# renders, and skips the first 6 lines - the Jekyll front-matter
RENDERED_RELEASE_NOTES=$(bundle exec .travis/render_release_notes.rb docs/pages/release_notes.md | tail -n +6)
RELEASE_NAME="PMD ${VERSION} ($(date -u +%d-%B-%Y))"
gh_release_updateRelease "$GH_RELEASE" "$RELEASE_NAME" "$RENDERED_RELEASE_NOTES"
sourceforge_uploadReleaseNotes "${VERSION}" "${RENDERED_RELEASE_NOTES}"
publish_release_documentation_github
sourceforge_rsyncSnapshotDocumentation "${VERSION}" "pmd-${VERSION}"
fi
}
#
# Executes jekyll and generates the documentation
# The documentation will be generated in the directory "docs/_site".
#
function generate_jekyll_doc() {
pushd docs
echo -e "\n\n"
log_info "Building documentation using jekyll..."
bundle install
bundle exec jekyll build
popd
}
#
# Creates the pmd-doc.zip archive. It will be placed in "docs/".
#
function create_pmd-doc_archive() {
pushd docs
echo -e "\n\n"
log_info "Creating pmd-doc archive..."
mv _site pmd-doc-${VERSION}
zip -qr pmd-doc-${VERSION}.zip pmd-doc-${VERSION}/
log_success "Successfully created pmd-doc-${VERSION}.zip"
popd
}
#
# Publishes the site to https://pmd.github.io/pmd-${VERSION} and
# https://pmd.github.io/latest/
#
function publish_release_documentation_github() {
echo -e "\n\n"
log_info "Adding the new doc to pmd.github.io..."
# clone pmd.github.io. Note: This uses the ssh key setup earlier
# In order to speed things up, we use a sparse checkout - no need to checkout all directories here
mkdir pmd.github.io
(
cd pmd.github.io
git init
git config user.name "Travis CI (pmd-bot)"
git config user.email "andreas.dangel+pmd-bot@adangel.org"
git config core.sparsecheckout true
git remote add origin git@github.com:pmd/pmd.github.io.git
echo "/latest/" > .git/info/sparse-checkout
echo "/sitemap.xml" >> .git/info/sparse-checkout
git pull --depth=1 origin master
log_info "Copying documentation from ../docs/pmd-doc-${VERSION}/ to pmd-${VERSION}/ ..."
rsync -ah --stats ../docs/pmd-doc-${VERSION}/ pmd-${VERSION}/
git status
echo "Executing: git add pmd-${VERSION}"
git add pmd-${VERSION}
echo "Executing: git commit..."
git commit -q -m "Added pmd-${VERSION}"
log_info "Copying pmd-${VERSION} to latest ..."
git rm -qr latest
cp -a pmd-${VERSION} latest
echo "Executing: git add latest"
git add latest
echo "Executing: git commit..."
git commit -q -m "Copying pmd-${VERSION} to latest"
log_info "Generating sitemap.xml"
../.travis/sitemap_generator.sh > sitemap.xml
echo "Executing: git add sitemap.xml"
git add sitemap.xml
echo "Executing: git commit..."
git commit -q -m "Generated sitemap.xml"
echo "Executing: git push origin master"
git push origin master
)
}
#
# Updates github pages of the main repository,
# so that https://pmd.github.io/pmd/ has the latest (snapshot) content
#
function publish_to_github_pages() {
echo -e "\n\n"
log_info "Pushing the new site to github pages..."
git clone --branch gh-pages --depth 1 git@github.com:pmd/pmd.git pmd-gh-pages
# clear the files first
rm -rf pmd-gh-pages/*
# copy the new site
cp -a docs/pmd-doc-${VERSION}/* pmd-gh-pages/
(
cd pmd-gh-pages
git config user.name "Travis CI (pmd-bot)"
git config user.email "andreas.dangel+pmd-bot@adangel.org"
git add -A
MSG="Update documentation
TRAVIS_JOB_NUMBER=${TRAVIS_JOB_NUMBER}
TRAVIS_COMMIT_RANGE=${TRAVIS_COMMIT_RANGE}"
git commit -q -m "$MSG"
git push git@github.com:pmd/pmd.git HEAD:gh-pages
log_success "Successfully pushed site to https://pmd.github.io/pmd/"
)
}
main
-28
View File
@@ -1,28 +0,0 @@
#!/bin/bash
set -e
source .travis/logger.sh
source .travis/common-functions.sh
source .travis/github-releases-api.sh
source .travis/sourceforge-api.sh
VERSION=$(./mvnw -q -Dexec.executable="echo" -Dexec.args='${project.version}' --non-recursive org.codehaus.mojo:exec-maven-plugin:1.5.0:exec)
log_info "PMD Release ${VERSION}"
if ! travis_isPush; then
log_info "Not publishing release, since this is not a push!"
exit 0
fi
if [[ "${VERSION}" == *-SNAPSHOT || "${TRAVIS_TAG}" == "" ]]; then
log_info "Not publishing release, since this is not a release!"
exit 0
fi
# Publish github release
gh_releases_getLatestDraftRelease
GH_RELEASE="$RESULT"
gh_release_publishRelease "$GH_RELEASE"
sourceforge_selectDefault "${VERSION}"
Loaded 30 of 2226 files, more files were not shown because too many files have changed in this diff. Show more