-
-
Notifications
You must be signed in to change notification settings - Fork 3.8k
Description
from #13754 (comment)
We think our documentation at https://checkstyle.org/property_types.html#Pattern.5B.5D is either wrong or misleading.
Found looking at https://checkstyle.org/checks/metrics/classfanoutcomplexity.html#Properties
The string representation is parsed as a set of forward slash ('/') separated patterns.
When glancing at this, i thought it meant each pattern is separated by a /
.
But looking at the code at
Line 160 in 5a0f923
public void setExcludeClassesRegexps(String... from) { |
/
.
Even createPattern
method that it calls does nothing with /
, so I don't understand where the /
is coming from.
https://github.com/search?q=repo%3Acheckstyle%2Fcheckstyle+%22Pattern.5B.5D%22+path%3A%2F%5Esrc%5C%2Fxdocs%5C%2Fchecks%5C%2F%2F&type=code
We have 6 checks with this type.
It looks like documentation is coming from
checkstyle/src/main/java/com/puppycrawl/tools/checkstyle/checks/imports/ImportOrderCheck.java
Line 759 in 5a0f923
else if (pkg.startsWith(FORWARD_SLASH)) { |
We need review all Patern[] usage and probably move ImportOrderCheck to have special type.
how we can support list of Pattern, when "," can be used in regexp.
agreement on how to fix we archived at #14764 (comment)
Migration Notes:
ImportOrder
is update to replace Pattern[]
with String[]
type for properties staticGroups
and groups
.
user who use xml config are not affected, but plugins who might have type validation during Check configuration (before Check execution) might be affected. Validation type in metadata is different from 10.17.0 for this Check.