You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
if (isXmlConfig) {
final String stringXmlConfig = LATEST_DTD + String.join("", inlineConfig);
final InputSource inputSource = new InputSource(new StringReader(stringXmlConfig));
final Configuration xmlConfig = ConfigurationLoader.loadConfiguration(
inputSource, new PropertiesExpander(System.getProperties()),
ConfigurationLoader.IgnoredModulesOptions.EXECUTE
);
resulted config is fully ready to be used in validation execution.
protected final void verifyFilterWithInlineConfigParser(String filePath,
String[] expectedUnfiltered,
String... expectedFiltered)
throws Exception {
final TestInputConfiguration testInputConfiguration =
InlineConfigParser.parseWithFilteredViolations(filePath);
final DefaultConfiguration configWithoutFilters =
testInputConfiguration.createConfigurationWithoutFilters();
final List<TestInputViolation> violationsWithoutFilters =
new ArrayList<>(testInputConfiguration.getViolations());
violationsWithoutFilters.addAll(testInputConfiguration.getFilteredViolations());
Collections.sort(violationsWithoutFilters);
verifyViolations(configWithoutFilters, filePath, violationsWithoutFilters);
verify(configWithoutFilters, filePath, expectedUnfiltered);
final DefaultConfiguration configWithFilters =
testInputConfiguration.createConfiguration();
Detailed slicing and dicing by modules was required for property config in this case we need to recreate config and do bunch of assumptions on Checker and Treewalker. But in XML config all detals are provided, just use it as is.
Expected:
this code should not do any extra operations on config, and after parsing from xml should be used as is.
detected at https://github.com/checkstyle/checkstyle/pull/14462/files#r1521442922
When we use full XML config in header comment, we parse it, split by modules, and later on assemble back to
DefaultConfiguration
parsing of full XML:
checkstyle/src/test/java/com/puppycrawl/tools/checkstyle/bdd/InlineConfigParser.java
Line 238 in 2c00d23
resulted config is fully ready to be used in validation execution.
problem comes from
createConfigurationWithoutFilters
and other methods that are used not in general tests but in Filter tests:https://github.com/checkstyle/checkstyle/blob/master/src/test/java/com/puppycrawl/tools/checkstyle/AbstractModuleTestSupport.java
Detailed slicing and dicing by modules was required for property config in this case we need to recreate config and do bunch of assumptions on Checker and Treewalker. But in XML config all detals are provided, just use it as is.
Expected:
this code should not do any extra operations on config, and after parsing from xml should be used as is.
checkstyle/src/test/java/com/puppycrawl/tools/checkstyle/AbstractModuleTestSupport.java
Lines 232 to 238 in 2c00d23
instead of
createConfiguration()
we should have simplegetConfiguration()
The text was updated successfully, but these errors were encountered: