Issue #78: extract: grab property info#84
Conversation
This is a limitation of Checkstyle.
Everything is recognized as String if it isn't identified as one of the others. This doesn't mean it is truly String. |
e01cedb to
577d413
Compare
|
@Luolc Until the issues I mentioned above are done, I don't think we can rely fully on the type we get from Checkstyle. Even if we do get all types, we would need more reflection to get enumeration values as they could change between releases or in PR. Did you plan to use the types gathered and how? |
|
|
||
| <suppressions> | ||
| <suppress checks="MultipleStringLiteralsExtended" files=".*[\\/]src[\\/]test[\\/]"/> | ||
| <suppress checks="MultipleStringLiteralsExtended" files="[\\/]ExtractInfoGeneratorTest.java$|.*[\\/]src[\\/]test[\\/]"/> |
There was a problem hiding this comment.
If we are not going to fix this for any custom tests, put path and Test name as suppression.
Example: .*extract[\\/]\w+Test\.java
| <suppress checks="AvoidStaticImport" files=".*[\\/]src[\\/]test[\\/]"/> | ||
| <suppress checks="WriteTag" files=".*[\\/]src[\\/]test[\\/]"/> | ||
| <suppress checks="MultipleStringLiterals" files=".*[\\/]src[\\/]test[\\/]"/> | ||
| <suppress checks="MultipleStringLiterals" files="[\\/]ExtractInfoGeneratorTest.java$|.*[\\/]src[\\/]test[\\/]"/> |
| </Match> | ||
| <Match> | ||
| <!-- We can't change generated source code. --> | ||
| <Class name="~.*\.GsonAdapters.*"/> |
There was a problem hiding this comment.
Where is this file/class? I can't remember.
| private static final Set<String> FILESET_PROPERTIES = getProperties(AbstractFileSetCheck.class); | ||
|
|
||
| /** Properties without document. */ | ||
| private static final List<String> UNDOCUMENTED_PROPERTIES = Arrays.asList( |
There was a problem hiding this comment.
We are not documenting properties here.
This is more a list of fields that aren't properties.
| */ | ||
| public class ExtractInfoGeneratorTest { | ||
| /** Modules which do not have global properties to drop. */ | ||
| private static final List<String> XML_FILESET_LIST = Arrays.asList( |
There was a problem hiding this comment.
Can we drop this and use the check's class hierarchy to determine the parent?
| object.add("hierarchies", hierarchies); | ||
|
|
||
| final JsonUtil.JsonArray properties = new JsonUtil.JsonArray(); | ||
| for (String propertyName : getNecessaryProperties(clazz)) { |
There was a problem hiding this comment.
Add empty line before for and after } for for.
|
@Luolc ping |
1 similar comment
|
@Luolc ping |
#78
Processing result: https://gist.github.com/Luolc/241c6e730deff72035abdb8e7feae889
Add property name and type.
Now type could be detected as follows:
Comparing to http://checkstyle.sourceforge.net/property_types.html,
Patternis the type ofRegexp. Other enums are all seen as string. I haven't find a proper way to handle all the enums currently.