Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion lib/pmdtester/builders/rule_set_builder.rb
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,7 @@ def check_single_filename?(filename, categories, rules)

# matches Java-based rule implementations
match_data = %r{.+/src/main/java/.+/lang/([^/]+)/rule/([^/]+)/([^/]+)Rule.java}.match(filename)
unless match_data.nil?
unless match_data.nil? || match_data[3].start_with?('Abstract')
logger.debug "Matches: #{match_data.inspect}"
rules.add("#{match_data[1]}/#{match_data[2]}.xml/#{match_data[3]}")
return true
Expand Down
10 changes: 10 additions & 0 deletions test/test_rule_set_builder.rb
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,16 @@ def test_build_design_codestyle_config
assert_equal(expected, actual)
end

def test_build_all_rulesets_config_abstract_rule_changed
diff_filenames = <<~DOC
pmd-java/src/main/java/net/sourceforge/pmd/lang/java/rule/internal/AbstractJavaRulechainRule.java
DOC
mock_build?(diff_filenames, nil, "#{PATH_TO_TEST_RESOURCES}/patch-ruleset.xml")

assert(!File.exist?(RuleSetBuilder::PATH_TO_DYNAMIC_CONFIG),
"File #{RuleSetBuilder::PATH_TO_DYNAMIC_CONFIG} must not exist")
end

def test_build_all_rulesets_config
diff_filenames = <<~DOC
pmd-apex/src/main/java/net/sourceforge/pmd/lang/apex/rule/bestpractices/AvoidGlobalModifierRule.java
Expand Down