[jira] [Updated] (LUCENE-4409) implement javadocs linting with eclipse ecj compiler
[ https://issues.apache.org/jira/browse/LUCENE-4409?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Uwe Schindler updated LUCENE-4409: -- Attachment: LUCENE-4409-componentdef.patch Patch - Uses componentdef to load the ECJ compiler, so the classloader can be reused like with taskdef. - It also adds taskname=ecj-lint als param to javac, so the log output is nice. - The compilearg/ has to use value=... instead of line, otherwise it breaks with whitespace in the properties file path. I will commit that soon, just doing final checks! implement javadocs linting with eclipse ecj compiler Key: LUCENE-4409 URL: https://issues.apache.org/jira/browse/LUCENE-4409 Project: Lucene - Core Issue Type: Task Components: general/build Reporter: Robert Muir Assignee: Uwe Schindler Fix For: 4.1, 5.0 Attachments: LUCENE-4409-componentdef.patch, LUCENE-4409.patch, LUCENE-4409.patch today we have a lot of custom python scripts checking javadocs (checking for missing stuff too). Most of this is implemented by parsing html etc (some of this should stay this way, like broken-link detection) But actually the eclipse compiler can do most of this type of linting, and has a lot of options for it. We can pull it via ivy and run it from the command-line. I tested this manually by adding a bogus throws clause to Codec.java, downloading the ecj.jar from maven and running it manually: {noformat} rmuir@beast:~/workspace/lucene-trunk/lucene/core/src/java$ java -cp ~/Downloads/ecj-3.7.2.jar org.eclipse.jdt.internal.compiler.batch.Main -source 1.6 -d none -enableJavadoc -properties ~/workspace/lucene-trunk/dev-tools/eclipse/.settings/org.eclipse.jdt.core.prefs . ... -- 120. ERROR in /home/rmuir/workspace/lucene-trunk/lucene/core/src/java/./org/apache/lucene/codecs/Codec.java (at line 59) * @throws IOException */ ^^^ Javadoc: Exception IOException is not declared -- {noformat} here i specified -d none (don't generate class files), and essentially told it to read the compiler warnings/errors options set in the dev-tools config. For javadocs-lint we would want our own separate properties file that disables the ordinary java warnings (because eclipse can warn/error/ignore on lots of things, not just javadocs, and does by default). Separately we could also use this to check/fail/warn on other things besides javadoc... -- This message is automatically generated by JIRA. If you think it was sent incorrectly, please contact your JIRA administrators For more information on JIRA, see: http://www.atlassian.com/software/jira - To unsubscribe, e-mail: dev-unsubscr...@lucene.apache.org For additional commands, e-mail: dev-h...@lucene.apache.org
[jira] [Updated] (LUCENE-4409) implement javadocs linting with eclipse ecj compiler
[ https://issues.apache.org/jira/browse/LUCENE-4409?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Robert Muir updated LUCENE-4409: Attachment: LUCENE-4409.patch Almost got this working, two bugs to resolve: # a bug in eclipse compiler (imo), i tell it to create no class files, but its creating some for spatial (package-info.class processing) because it uses package-info.java instead of package.html. I'll make the macro use a throwaway directory and delete it. # a bug in solrj javadocs: it links to the lucene queryparser syntax incorrectly. I don't know why this is working with 'ant javadocs', but it really shouldnt, since lucene queryparser should not be in its compile classpath. I'll fix it to use docRoot. implement javadocs linting with eclipse ecj compiler Key: LUCENE-4409 URL: https://issues.apache.org/jira/browse/LUCENE-4409 Project: Lucene - Core Issue Type: Task Components: general/build Reporter: Robert Muir Attachments: LUCENE-4409.patch today we have a lot of custom python scripts checking javadocs (checking for missing stuff too). Most of this is implemented by parsing html etc (some of this should stay this way, like broken-link detection) But actually the eclipse compiler can do most of this type of linting, and has a lot of options for it. We can pull it via ivy and run it from the command-line. I tested this manually by adding a bogus throws clause to Codec.java, downloading the ecj.jar from maven and running it manually: {noformat} rmuir@beast:~/workspace/lucene-trunk/lucene/core/src/java$ java -cp ~/Downloads/ecj-3.7.2.jar org.eclipse.jdt.internal.compiler.batch.Main -source 1.6 -d none -enableJavadoc -properties ~/workspace/lucene-trunk/dev-tools/eclipse/.settings/org.eclipse.jdt.core.prefs . ... -- 120. ERROR in /home/rmuir/workspace/lucene-trunk/lucene/core/src/java/./org/apache/lucene/codecs/Codec.java (at line 59) * @throws IOException */ ^^^ Javadoc: Exception IOException is not declared -- {noformat} here i specified -d none (don't generate class files), and essentially told it to read the compiler warnings/errors options set in the dev-tools config. For javadocs-lint we would want our own separate properties file that disables the ordinary java warnings (because eclipse can warn/error/ignore on lots of things, not just javadocs, and does by default). Separately we could also use this to check/fail/warn on other things besides javadoc... -- This message is automatically generated by JIRA. If you think it was sent incorrectly, please contact your JIRA administrators For more information on JIRA, see: http://www.atlassian.com/software/jira - To unsubscribe, e-mail: dev-unsubscr...@lucene.apache.org For additional commands, e-mail: dev-h...@lucene.apache.org
[jira] [Updated] (LUCENE-4409) implement javadocs linting with eclipse ecj compiler
[ https://issues.apache.org/jira/browse/LUCENE-4409?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Robert Muir updated LUCENE-4409: Attachment: LUCENE-4409.patch updated patch: everything is passing. Ill run precommit and get this thing in (trunk/4x only): i spent a lot of time cleaning up docs and want to keep the bar high. we can adjust the properties as needed later as more cleanup happens, but i dont want to let them get any worse. implement javadocs linting with eclipse ecj compiler Key: LUCENE-4409 URL: https://issues.apache.org/jira/browse/LUCENE-4409 Project: Lucene - Core Issue Type: Task Components: general/build Reporter: Robert Muir Attachments: LUCENE-4409.patch, LUCENE-4409.patch today we have a lot of custom python scripts checking javadocs (checking for missing stuff too). Most of this is implemented by parsing html etc (some of this should stay this way, like broken-link detection) But actually the eclipse compiler can do most of this type of linting, and has a lot of options for it. We can pull it via ivy and run it from the command-line. I tested this manually by adding a bogus throws clause to Codec.java, downloading the ecj.jar from maven and running it manually: {noformat} rmuir@beast:~/workspace/lucene-trunk/lucene/core/src/java$ java -cp ~/Downloads/ecj-3.7.2.jar org.eclipse.jdt.internal.compiler.batch.Main -source 1.6 -d none -enableJavadoc -properties ~/workspace/lucene-trunk/dev-tools/eclipse/.settings/org.eclipse.jdt.core.prefs . ... -- 120. ERROR in /home/rmuir/workspace/lucene-trunk/lucene/core/src/java/./org/apache/lucene/codecs/Codec.java (at line 59) * @throws IOException */ ^^^ Javadoc: Exception IOException is not declared -- {noformat} here i specified -d none (don't generate class files), and essentially told it to read the compiler warnings/errors options set in the dev-tools config. For javadocs-lint we would want our own separate properties file that disables the ordinary java warnings (because eclipse can warn/error/ignore on lots of things, not just javadocs, and does by default). Separately we could also use this to check/fail/warn on other things besides javadoc... -- This message is automatically generated by JIRA. If you think it was sent incorrectly, please contact your JIRA administrators For more information on JIRA, see: http://www.atlassian.com/software/jira - To unsubscribe, e-mail: dev-unsubscr...@lucene.apache.org For additional commands, e-mail: dev-h...@lucene.apache.org