Conversation
Remove data source adapter
071e28c to
d797c86
Compare
adangel
left a comment
There was a problem hiding this comment.
I leave merging this up to you.
Thanks for the work!
pmd-html/src/main/java/net/sourceforge/pmd/lang/html/ast/ASTHtmlDocument.java
Show resolved
Hide resolved
pmd-java/src/main/java/net/sourceforge/pmd/lang/java/ast/SingleLineComment.java
Show resolved
Hide resolved
...pex/src/test/resources/net/sourceforge/pmd/lang/apex/rule/errorprone/xml/EmptyCatchBlock.xml
Outdated
Show resolved
Hide resolved
|
Ok, the regression tester ran now... but with some more work to do: It seems, the reported file names are now different.... all violations have been removed and added. It's easier to look at a smaller project, like https://chunk.io/pmd/23054915090a48adb1f094dcfc0e981a/diff1/Schedul-o-matic-9000/index.html The xml report (baseline): https://chunk.io/pmd/23054915090a48adb1f094dcfc0e981a/diff1/Schedul-o-matic-9000/base_pmd_report.xml <file name="/home/runner/work/pmd/target/repositories/Schedul-o-matic-9000/force-app/main/default/classes/Dao.cls">
<violation beginline="8" endline="8" begincolumn="14" endcolumn="16" rule="ApexSharingViolations" ruleset="Security" externalInfoUrl="https://pmd.github.io/pmd/pmd_rules_apex_security.html#apexsharingviolations" priority="3">
Apex classes should declare a sharing model if DML or SOQL/SOSL is used
</violation>
...The xml report (patch): https://chunk.io/pmd/23054915090a48adb1f094dcfc0e981a/diff1/Schedul-o-matic-9000/patch_pmd_report.xml <file name="target/repositories/Schedul-o-matic-9000/force-app/main/default/classes/Dao.cls">
<violation beginline="8" endline="8" begincolumn="14" endcolumn="17" rule="ApexSharingViolations" ruleset="Security" externalInfoUrl="https://pmd.github.io/pmd/pmd_rules_apex_security.html#apexsharingviolations" priority="3">
Apex classes should declare a sharing model if DML or SOQL/SOSL is used
</violation>
...The filenames are now relativized already... but only to the current working directory (probably). |
|
Thanks for looking into this Andreas. One thing to keep in mind is that this PR changes the implementation of the "short file name" functionality. The TextFiles are all created with a "display name", which is relativized if the short file name option is enabled, but it's not absolutized otherwise -> this is probably the reason for the difference. So the display name is absolute only if you use an absolute path as a CLI argument, which the regression tester is probably not doing. I think this is sensible behaviour (at least it's consistent), but maybe we should think more about this... I think the good thing about this is that the report is maybe more portable. But some renderers might mandate relative or absolute paths, like #3798 shows |
|
I think, both behaviors make sense. But since we are on PMD 7, we can change it...
👍 Hm... theoretically, we don't need to change the regression tester. It would work after this PR is merged, then the baseline also has the same paths in the report... |
70d3a40 to
df4dc68
Compare
df4dc68 to
0057492
Compare
Describe the PR
(this now contains #3892)
Changelog
pmd-apex
pmd-core
\ngetTextRegionis a new abstract method.getReportLocationis not abstract anymore. TextAvailableNode refines the contract ofgetTextRegionto mean that the text region is the exact boundaries of the node in the text, which is eg not the case for the apex module, but is the case for Javacc-based modules.Some usage of Path and File are replaced with String in eg Ruleset#applies (file name filters) because TextFile uses strings as path names.
CPD
pmd-java
pmd-lang-test
pmd-test
String::trim()which doesn't preserve indent on the first line. Now it uses basically a clone ofString::stripIndent(method used by text blocks in JDK 16+) so that the code behaves like a text block (without escapes)pmd-cpp
Future refactorings:
Related issues
Ready?
./mvnw clean verifypasses (checked automatically by github actions)