Skip to content

Commit

Permalink
This is a squash commit of the following previous commits:
Browse files Browse the repository at this point in the history
Merge branch 'master' into website

---

Undo Refaster test package split, glue it together

---

Introduce `RefasterRuleTestExtractor` for documentation generation

This new `Extractor` implementation collects Refaster example input and
output code from rule collection tests.

This change also introduces explicit compilation steps for the test
code. As a side-effect this produces faster feedback in case of invalid
input or output code.

(cherry picked from commit c8c5107)

---

Try fix build

---

Post-rebase fix

---

Publish Error Prone compatibility matrix on website

The new `website/generate-version-compatibility-overview.sh` script
tests all combinations, and stores the result in a Jekyll data file.

---

Some cleanup

---

Make tests more maintainable

---

Try to fix htmlproofer

---

Fix source links

---

Introduce `BugPatternTestExtractor` with tests

---

Simplify tests

---

Further simplify testing setup

---

Kill another mutant and drop unused imports

---

This actually kills the mutant

---

Suggestions

---

Suggestions

---

Suggestions

---

Fix JDK 11 compatibility

---

PSM-1717 Pass `ClassLoader` to `ServiceLoader`

---

Introduce documentation generation

This is a squash commit of the following previous commits:

---

Introduce `documentation-support` module to extract website data from source code

By adding a compilation `TaskListener` that extracts data from the Bug pattern
and Refaster rule collection (test) classes and writing to JSON output files
in the target directory. This extraction happens as part of the Maven build
using the `docgen` profile.

---

Improve website styling

Co-authored-by: japborst <[email protected]>
Co-authored-by: Gijs de Jong <[email protected]>

---

Generate Markdown files from existing content for the website

---

Upgrade dependencies to the latest versions

---

Compile and install project jars before docgen

---

Run validation in build and exclude self-url

---

Reintroduce `htmlproofer`, improve templates, cleanup setup and dependencies

---

Delete directory if it exists

---

Add SCSS for GitHub button and fix bug pattern sample rendering

---

Fix bug pattern GitHub link

---

Small styling tweaks (incl. for dark theme)

---

Use single mvn command

---

Move mustache templates

---

Hardcode anchors for headings

---

Add supression to bugpatterns

---

Remove self ignore for html-proofer

---

Add refaster supressions and use callouts

---

Use v0.4.1-SNAPSHOT

---

Revert "Use single mvn command"

This reverts commit 594471d.

---

Extract Refaster samples from source code instead of AST

---

Skip verification, for now

---

Add notes on disabling bugpatterns

---

Set default layout and image

---

Fix mobile navigation

---

Revert "Set default layout and image"

This reverts commit 67a4aa7.

---

Add supression for refaster rules

---

Post-rebase fixes

---

Fix the tests

---

Doh

---

Version bump

---

Exclude ThirdPartyLibraryTest from Bug Pattern test output

---

Remove only last occurence of 'Test' in Bug Pattern tests doc generation

---

Move `MapRulesTest` resources

---

Add exclusion for docgen of `SourceCodeTest`

---

Bump version

---

Extra fixes after rebase

---

Delete custom nav footer and `assets/images/favicon.ico`

---

Post rebase fixes with version bump to `0.8.1-SNAPSHOT`

---

Use new BugPatternTest extraction method

---

Fit Refaster extractors into new documentation support setup

---

Drop Docgen Maven profile

---

Move new rule collection

---

Improve extractor matching and update README

---

Move `SuggestedFixRules` test files

---

Fix Refaster exclusion regexes

---

Disable external link checking until the `website` branch is up-to-date with `master` again

---

Post-rebase fix

---

Not sure why `-Dverification.skip` fails while `-Dverification.warn` doesn't; won't investigate right now

---

Check external links again

---

Upgrade dependencies

---

WIP: towards dropping Mustache

---

WIP: Java doc generator

---

WIP: switch over

---

WIP: Cleanup

---

Polish

---

Bump dependencies

---

Bump Ruby

---

Sync more

---

Fix bug checker GitHub URLs

---

Fix HTMLProofer config
  • Loading branch information
Stephan202 committed Feb 2, 2025
1 parent e572a36 commit c995265
Show file tree
Hide file tree
Showing 20 changed files with 927 additions and 78 deletions.
18 changes: 11 additions & 7 deletions .github/workflows/deploy-website.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,26 +39,30 @@ jobs:
www.bestpractices.dev:443
www.youtube.com:443
youtrack.jetbrains.com:443
- name: Check out code
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
- name: Check out code and set up JDK and Maven
uses: s4u/setup-maven-action@4f7fb9d9675e899ca81c6161dadbba0189a4ebb1 # v1.18.0
with:
persist-credentials: false
java-version: 17.0.13
java-distribution: temurin
maven-version: 3.9.9
- uses: ruby/setup-ruby@28c4deda893d5a96a6b2d958c5b47fc18d65c9d3 # v1.213.0
with:
working-directory: ./website
bundler-cache: true
- name: Configure Github Pages
uses: actions/configure-pages@983d7736d9b0ae728b81ab479565c72886d7745b # v5.0.0
- name: Compile project and extract data
run: mvn -T1C clean install -DskipTests -Dverification.skip
- name: Generate documentation
run: ./generate-docs.sh
run: mvn exec:java@generate-docs -pl documentation-support
- name: Build website with Jekyll
working-directory: ./website
run: bundle exec jekyll build
- name: Validate HTML output
working-directory: ./website
# XXX: Drop `--disable_external true` once we fully adopted the
# "Refaster rules" terminology on our website and in the code.
run: bundle exec htmlproofer --disable_external true --check-external-hash false ./_site
# XXX: Bealdung and StackOverflow return HTTP 403 responses when run on
# a GitHub Action node.
run: bundle exec htmlproofer --no-check-external-hash --swap-url 'https\://error-prone.picnic.tech:' --ignore-urls '/^https:\/\/(www\.baeldung\.com|stackoverflow\.com)\/.*/' ./_site
- name: Upload website as artifact
uses: actions/upload-pages-artifact@56afc609e74202658d3ffba0e8f6dda462b719fa # v3.0.1
with:
Expand Down
37 changes: 37 additions & 0 deletions documentation-support/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -28,10 +28,18 @@
<groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-annotations</artifactId>
</dependency>
<dependency>
<groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-core</artifactId>
</dependency>
<dependency>
<groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-databind</artifactId>
</dependency>
<dependency>
<groupId>com.fasterxml.jackson.dataformat</groupId>
<artifactId>jackson-dataformat-yaml</artifactId>
</dependency>
<dependency>
<groupId>com.fasterxml.jackson.datatype</groupId>
<artifactId>jackson-datatype-guava</artifactId>
Expand Down Expand Up @@ -76,6 +84,10 @@
<groupId>com.google.guava</groupId>
<artifactId>guava</artifactId>
</dependency>
<dependency>
<groupId>io.github.java-diff-utils</groupId>
<artifactId>java-diff-utils</artifactId>
</dependency>
<dependency>
<groupId>org.assertj</groupId>
<artifactId>assertj-core</artifactId>
Expand Down Expand Up @@ -104,4 +116,29 @@
<scope>test</scope>
</dependency>
</dependencies>

<build>
<pluginManagement>
<plugins>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>exec-maven-plugin</artifactId>
<executions>
<execution>
<id>generate-docs</id>
<goals>
<goal>java</goal>
</goals>
<configuration>
<mainClass>tech.picnic.errorprone.documentation.JekyllCollectionGenerator</mainClass>
<arguments>
<argument>${maven.multiModuleProjectDirectory}</argument>
</arguments>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</pluginManagement>
</build>
</project>
Loading

0 comments on commit c995265

Please sign in to comment.