Compare commits

...

1 Commits

Author SHA1 Message Date
Stephan Schroevers
f9910160c7 WIP: Generate documentation
(Manual run with `mvn exec:java@generate-bugpattern-docs -pl refaster-runner`.)

TODO: Actually hook this up in a website
2023-01-07 18:31:57 +01:00
3 changed files with 58 additions and 0 deletions

View File

@@ -242,5 +242,11 @@
</plugin>
</plugins>
</pluginManagement>
<plugins>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>exec-maven-plugin</artifactId>
</plugin>
</plugins>
</build>
</project>

36
pom.xml
View File

@@ -810,6 +810,11 @@
<artifactId>error_prone_core</artifactId>
<version>${version.error-prone}</version>
</path>
<path>
<groupId>${groupId.error-prone}</groupId>
<artifactId>error_prone_docgen_processor</artifactId>
<version>${version.error-prone}</version>
</path>
<path>
<groupId>com.google.auto.value</groupId>
<artifactId>auto-value</artifactId>
@@ -1089,6 +1094,37 @@
<artifactId>build-helper-maven-plugin</artifactId>
<version>3.3.0</version>
</plugin>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>exec-maven-plugin</artifactId>
<version>3.0.0</version>
<configuration>
<mainClass>com.google.errorprone.DocGenTool</mainClass>
<arguments>
<argument>-bug_patterns=${project.build.directory}/generated-sources/annotations/bugPatterns.txt</argument>
<argument>-docs_repository=${project.build.directory}/generated-wiki/</argument>
<argument>-explanations=${basedir}/src/main/docs/bugpattern/</argument>
<argument>-target=external</argument>
</arguments>
<includePluginDependencies>true</includePluginDependencies>
</configuration>
<dependencies>
<dependency>
<groupId>com.google.errorprone</groupId>
<artifactId>error_prone_docgen</artifactId>
<version>${version.error-prone}</version>
</dependency>
</dependencies>
<executions>
<execution>
<id>generate-bugpattern-docs</id>
<goals>
<goal>java</goal>
</goals>
<phase>process-classes</phase>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>license-maven-plugin</artifactId>

View File

@@ -0,0 +1,16 @@
Error Prone's out-of-the-box support for the application of
[Refaster][refaster] templates is somewhat cumbersome. Additionally, by default
the focus of Refaster templates is on one-off code refactorings.
This plugin attempts to bring Refaster templates on equal footing with other
Error Prone plugins by locating all Refaster templates on the classpath and
reporing any match. The suggested changes can be applied using Error Prone's
built-in [patch][patching] functionality.
XXX: Expand documentation. Mention:
- The `refaster-resource-compiler`.
- How checks can be restricted using the `NamePattern` flag (see the Javadoc)
- An concrete patching example, with and without `NamePattern`.
[refaster]: https://errorprone.info/docs/refaster
[patching]: https://errorprone.info/docs/patching