rnveach commented on a change in pull request #7: [MCHECKSTYLE-357] - Allow 
inline configuration for reporting
URL: 
https://github.com/apache/maven-checkstyle-plugin/pull/7#discussion_r241754882
 
 

 ##########
 File path: 
src/main/java/org/apache/maven/plugins/checkstyle/AbstractCheckstyleReport.java
 ##########
 @@ -73,6 +74,10 @@
 
     protected static final String JAVA_FILES = "**\\/*.java";
 
+    private static final String CHECKSTYLE_FILE_HEADER = "<?xml 
version=\"1.0\"?>\n"
+            + "<!DOCTYPE module PUBLIC \"-//Puppy Crawl//DTD Check 
Configuration 1.3//EN\"\n"
+            + "        
\"http://www.puppycrawl.com/dtds/configuration_1_3.dtd\";>\n";
 
 Review comment:
   @eolivelli Obviously the latest one for the specific version is the best. To 
my knowledge, I don't think we have ever broken backwards compatibility with 
the DTDs.
   
   Unfortunately, I don't see anyway to retrieve this at runtime unless you use 
reflection on Checkstyle. The fields are private and there is nothing besides 
numbers that says which is the latest. I also don't think the field names had 
the same pattern on old versions.
   See 
https://github.com/checkstyle/checkstyle/blob/master/src/main/java/com/puppycrawl/tools/checkstyle/ConfigurationLoader.java#L114-L116
 and 
https://github.com/checkstyle/checkstyle/blob/master/src/main/java/com/puppycrawl/tools/checkstyle/ConfigurationLoader.java#L181
 .
   
   If an official method is needed, please create an issue on Checkstyle, but 
this won't help with old versions, only future ones.

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
[email protected]


With regards,
Apache Git Services

Reply via email to