-
-
Notifications
You must be signed in to change notification settings - Fork 1.5k
Closed
Labels
an:enhancementAn improvement on existing features / rulesAn improvement on existing features / rulesin:pmd-internalsAffects PMD's internalsAffects PMD's internals
Milestone
Description
Is your feature request related to a problem? Please describe.
We often have rules, that make certain assumptions of the grammar. When we update the grammar to support a new Java version (like #3366), some rules might fail with a NPE (e.g. #3420).
Describe the solution you'd like
We should have a sample project on which pmd is executed by our regression tester, so that we see these problems earlier.
- new repository, e.g. pmd/java-regression-tests
- add this to https://github.com/pmd/pmd/blob/master/.ci/files/project-list.xml
- (optional) extend pmd-regression-tester, to support specifying the java version to be used when executing pmd. This is only needed if we want to use java preview versions (https://github.com/pmd/pmd-regression-tester/blob/c98e4a6d90f4aaf555ab52c84117d6c7787696a5/lib/pmdtester/builders/pmd_report_builder.rb#L100-L105 )
Describe alternatives you've considered
- Just run PMD in PMDCoverageTest on src/main/resources, where we have some source, that uses the new language - but then we don't run PMD with the proper auxclasspath, as these java files are not compiled. Because of that, some rules might stop early, if the type couldn't be resolved.
Additional context
- As a start, we can use the same code as in https://github.com/pmd/pmd/tree/master/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests
Metadata
Metadata
Assignees
Labels
an:enhancementAn improvement on existing features / rulesAn improvement on existing features / rulesin:pmd-internalsAffects PMD's internalsAffects PMD's internals