Andreas Dangel
dc19597020
[maven-release-plugin] prepare for next development iteration
2022-01-29 09:53:38 +01:00
Andreas Dangel
391c32589f
[maven-release-plugin] prepare release pmd_releases/6.42.0
2022-01-29 09:53:32 +01:00
Andreas Dangel
ba903437c0
[apex] ApexDoc - handle properties via "reportProperty".
2021-12-21 19:04:59 +01:00
babula
abfdb572d3
Add reportMissingProperty property
2021-12-17 13:34:47 -05:00
Andreas Dangel
3a97618d5d
[maven-release-plugin] prepare for next development iteration
2021-11-27 11:21:17 +01:00
Andreas Dangel
ac68de1f51
[maven-release-plugin] prepare release pmd_releases/6.41.0
2021-11-27 11:21:12 +01:00
Andreas Dangel
90931d64b7
Fix unused import
2021-11-18 12:14:26 +01:00
Andreas Dangel
febdfe0f4a
[apex] Fix exception handling for commons-lang3-reflect calls
2021-11-18 11:39:17 +01:00
Andreas Dangel
f12710071f
[maven-release-plugin] prepare for next development iteration
2021-10-30 10:00:20 +02:00
Andreas Dangel
be09a31654
[maven-release-plugin] prepare release pmd_releases/6.40.0
2021-10-30 10:00:15 +02:00
Andreas Dangel
f5fd79d489
Merge pull request #3582 from oowekyala:cleanup-3581
...
[apex] Cleanup after #3581 #3582
* pr-3582:
[apex] comments: use index instead of line/column to map to node
[apex] comments: consider position index in the same line
[apex] EmptyCatchBlock: Improve test case
Added a new test case verifying the expected boundary condition behavior for allowing commented blocks.
Cleanup after #3581
2021-10-29 09:50:17 +02:00
Andreas Dangel
2a8db8b97c
Merge branch 'master' into pr-3555
2021-10-28 11:35:12 +02:00
Andreas Dangel
b70b981145
[apex] comments: use index instead of line/column to map to node
2021-10-28 11:21:12 +02:00
Andreas Dangel
e05e0df39a
[apex] comments: consider position index in the same line
2021-10-28 11:07:39 +02:00
Andreas Dangel
f3c17a0e02
[apex] EmptyCatchBlock: Improve test case
...
also test for doc comments
2021-10-28 10:29:08 +02:00
Scott Wells
aa271e5bc3
Added a new test case verifying the expected boundary condition behavior for allowing commented blocks.
2021-10-28 09:22:44 +02:00
Clément Fournier
7a9d0db3a7
Cleanup after #3581
2021-10-24 17:11:57 +02:00
Scott Wells
e0cd2a6ae2
Made the check for whether a node contains comments more efficient. Instead of having to inspect all commented lines in the file for each comment container, we now pre-calculate an index of which lines were comments, and then we see whether any of the lines in a comment container's range are flagged in that index. Given that we're currently only going to perform this logic for ASTCatchBlockStatement nodes, hopefully this should be very efficient. If/when this logic is expanded to include other node types, we can revisit and determine whether another approach such as a binary search for lines in a given range is a better fit.
...
Made AbstractApexCommentContainerNode package-private.
2021-10-23 13:58:34 -05:00
Scott Wells
67c4f0bcb5
Addressed code review feedback, specifically providing tighter encapsulation for 'setContainsComment' and marking the 'ASTCommentContainer' interface as experimental.
2021-10-23 09:58:02 -05:00
Scott Wells
a692f81611
Merge branch 'master' into pmd-3569
2021-10-23 08:46:06 -05:00
Andreas Dangel
1b5408d49a
[apex] Update test, see #2775 / #3577
2021-10-23 11:21:32 +02:00
Robert Sösemann
f543babca6
Merge pull request #3575 from SCWells72/pmd-3570
...
[apex] Fix for #3570 - Added new configuration property reportInForLoopInitializer to OneDeclarationPerLine
2021-10-23 00:41:36 +02:00
Robert Sösemann
142b857750
Merge pull request #3573 from SCWells72/pmd-3568
...
[apex] Fix for #3568 - Added new configuration properties reportEmptyPrivateNoArgConstructor and reportEmptyVirtualMethod to EmptyStatementBlock
2021-10-23 00:38:38 +02:00
Robert Sösemann
0bc53fca8d
Merge pull request #3578 from SCWells72/pmd-3576
...
[apex] Documentation changes for #3576
2021-10-23 00:36:27 +02:00
Scott Wells
914614f6a2
Merge branch 'master' into pmd-3569
2021-10-22 13:44:43 -05:00
Scott Wells
98b6479ecb
Updated the rule documentation for the new config params.
2021-10-22 13:31:05 -05:00
Scott Wells
04096bbf01
Issue 3569 - Based on great feedback from Clément Fournier, decided to go a different route and add the exact same configuration properties that the analogous Java rule offers, specifically 'allowCommentedBlocks' and 'allowExceptionNameRegex', both with the exact same defaults as the Java rule, i.e., 'false' and '(expected|ignored)' respectively.
...
Adding 'allowExceptionNameRegex' was quite straightforward. However, 'allowCommentedBlocks' was a bit more challenging because there was no notion of whether a block contained comments. I had to augment the lexer/parser/tree builder logic to capture all comment tokens and then use them to denote whether a catch block contained comments of any sort. The way I did this with a new intermediate abstract base node class for comment containers, we could denote the same for the other Apex block node types. In the spirit of keeping these changes narrow in scope, though, I only changed the inheritance hierarchy for ASTCatchBlockStatement. If/when we need to be able to ask the same question about other block types, it should be trivial to update them to support it.
Test cases have been updated accordingly.
2021-10-22 13:01:19 -05:00
Robert Sösemann
b9f53ef56a
Merge pull request #3577 from SCWells72/pmd-3576
2021-10-22 19:38:42 +02:00
Robert Sösemann
e67f2a0400
Merge pull request #3572 from SCWells72/pmd-3566
2021-10-22 19:09:50 +02:00
Scott Wells
c919c4d058
Incorporated the code review feedback from another PR where applicable.
2021-10-22 09:41:20 -05:00
Scott Wells
dc0e1ee17f
Changes based on review feedback, specifically:
...
1) Only try to compile the configured pattern once if provided for both efficiency and noise suppression reasons. The suggested dysfunctionReason() approach was not used because that doesn't seem to be called when executing for unit tests. Happy to revisit this if I'm just missing something.
2) Catch more specific exceptions, in this case IllegalArgumentException which is thrown by Pattern#compile both as that type and as its sub-type PatternSyntaxException.
3) Document why we're using a string property and not a regex property so that we can control the pattern compilation params.
4) Add expected failure line numbers to the new test case.
2021-10-22 09:08:13 -05:00
Scott Wells
64595b801b
Added a compiled pattern cache for the configured method name patterns. Fixed some checkstyle-reported formatting issues.
2021-10-21 17:09:11 -05:00
Scott Wells
873f3527b2
Added information about an observed bug with authorization checks against sub-relations in static SOQL queries. Added a test case that reproduces the bug. Once the bug is fixed, the unit test expectation can be changed to provide both verification and a check against regressions.
2021-10-21 16:48:02 -05:00
Scott Wells
baad5701dc
Minor formatting corrections.
2021-10-21 16:47:59 -05:00
Scott Wells
b07686ae43
Added a test to verify the *TypeParamIndex configuration properties.
2021-10-21 16:47:56 -05:00
Scott Wells
2e0ea71617
Minor clean-up from branch-to-branch merge.
2021-10-21 15:58:06 -05:00
Scott Wells
57626f44d2
Added tests for read/queries. Changed to use set-based multimaps as duplicate entries aren't useful.
2021-10-21 15:54:39 -05:00
Scott Wells
4e1c17e297
Added support for undelete (except for ESAPI which doesn't support it anyway) and merge. Updated unit tests for this enhancement to include a combination of DML statements and Database methods.
2021-10-21 15:43:34 -05:00
Scott Wells
b843242e47
Issue 3576 - First commit for this work with support for most DML operations but not yet undelete (which doesn't seem to be supported at all yet) or merge, nor does it support read/query operations yet. I'll add those in subsequent commits, but I want to lay the foundation now that it seems to be in good shape.
2021-10-21 15:31:06 -05:00
Scott Wells
c20db33884
Issue 3570 - Added a new configuration property, 'reportInForLoopInitializer', that if set to false (default is true if unspecified) doesn't report an issue for multiple declarations in a for loop initializer.
2021-10-20 14:30:42 -05:00
Scott Wells
d5711f518c
Issue 3569 - Added a new configuration property, 'reportInTestMethod', that if set to false (default is true if unspecified) doesn't report an issue for empty catch blocks in test methods that are commonly used to verify that an expected exception has been thrown.
2021-10-20 14:07:16 -05:00
Scott Wells
ddd310eb63
Issue 3568 - Added a new configuration property, 'reportEmptyVirtualMethod', that if set to false (default is true if unspecified) doesn't report an issue for empty virtual methods that are commonly used in abstract base classes as default no-op implementations when partial override/specialization is typical in derived classes.
2021-10-20 13:29:39 -05:00
Scott Wells
ff6c178108
Issue 3568 - Added a new configuration property, 'reportEmptyPrivateNoArgConstructor', that if set to false (default is true if unspecified) doesn't report an issue for empty private no-arg constructors that are commonly used in singleton and utility class implementations according to respective best practices.
2021-10-20 13:15:44 -05:00
Scott Wells
efbe149f21
Issue 3566 - Added a new configuration property, 'reportMissingDescription', that if set to false (default is true if unspecified) doesn't report an issue if the '@description' tag is missing. This is consistent with the dialect supported by ApexDoc derivatives such as SfApexDoc.
2021-10-20 11:42:52 -05:00
Scott Wells
230fc4c805
Issue 1089 - Added a new configuration property, 'additionalAssertMethodPattern', that when specified is also evaluated against each invoked method name to determine whether it represents a test assertion. This will provide support for those who use testing facades such as sirono-common's Assert, or who encapsulate common assertions in local utility methods.
2021-10-20 11:40:35 -05:00
Andreas Dangel
ad951bcb85
[apex] Fix errors due to jorje update
2021-10-14 10:40:51 +02:00
Andreas Dangel
eeaa300b7b
[doc] Update release notes ( #3532 , #3538 )
2021-10-14 09:32:51 +02:00
Jonathan Wiesel
c331fa1a8d
Fixing docs and add other describer fetcher
2021-10-09 11:00:59 +02:00
Jonathan Wiesel
bd479e4cc4
Add GetDescribeShouldUseSObjectDescribeOptions Apex rule
2021-10-04 00:01:42 +02:00
Andreas Dangel
0399bbbfc8
[maven-release-plugin] prepare for next development iteration
2021-09-25 13:46:09 +02:00