Skip to content

Commit

Permalink
Link to oss-parent example and format.
Browse files Browse the repository at this point in the history
  • Loading branch information
japborst authored and rickie committed Aug 25, 2022
1 parent b5eac44 commit 0411b68
Show file tree
Hide file tree
Showing 2 changed files with 91 additions and 44 deletions.
63 changes: 44 additions & 19 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -1,37 +1,62 @@
# Contributing

Thank you for checking this document! This framework is free software, and we (the maintainers) encourage and value any contribution.
Thank you for checking this document! This framework is free software, and we
(the maintainers) encourage and value any contribution.

Here are some guidelines to help you get started.

## 🐛 Report a bug

Like any non-trivial piece of software, this framework is probably not bug-free. If you found a bug, feel free to report it to us via GitHub, in the Issues section.
Like any non-trivial piece of software, this framework is probably not bug-free.
If you found a bug, feel free to report it to us via GitHub, in the Issues
section.

Before doing so, try to search for your bug in the already existing ones - maybe it is already known, and maybe there's already a solution in place.
Before doing so, try to search for your bug in the already existing ones - maybe
it is already known, and maybe there's already a solution in place.

Be sure to use the latest version of the framework, and to provide in your bug report:
Be sure to use the latest version of the framework, and to provide in your bug
report:

- Information about your environment (at the very least, operating system and Java version).
- Information about your environment (at the very least, operating system and
Java version).
- Description of what is going on (e.g. logging output, stacktraces).
- A mininum reproducible example, so that other developers can try to reproduce the bug, and fix it.
- A mininum reproducible example, so that other developers can try to reproduce
the bug, and fix it.
- Any additional information that you deem necessary.

## 💡 Report an improvement

If you would like to see an improvement, you can file a GitHub issue. Also when you're already working towards opening up a Pull Request, this allows for discussion around the idea.
If you would like to see an improvement, you can file a GitHub issue. Also when
you're already working towards opening up a Pull Request, this allows for
discussion around the idea.

## 🚀 Open a Pull Request

All submissions, including submissions by project members, require at least two reviews. We use GitHub Pull Requests for this purpose.

Before opening a Pull Request, please check if there is not already one open that aims to solve same problem.

To the extend possible, the pull request process guards our coding guidelines. Some pointers:

- Checks should we topical: Ideally they address a single concern.
- Where possible checks should provide fixes, and ideally these are completely behavior preserving. In order for a check to be adopted by users it must not "get in the way". So for a check which addresses a relatively trivial stylistic concern it is doubly important that the violations it detects can be auto-patched.
- Make sure you have read Error Prone's criteria for new checks. Most guidelines described there apply to this project as well, except that this project does focus quite heavy on style enforcement. But that just makes the previous point doubly important.
- Make sure that a check's (mutation) coverage is or remains about as high as it can be. Not only does this lead to better tests, it also points out opportunities to simplify the code.
- Please restrict the scope of a pull request to a single feature or fix. Don't sneak in unrelated changes.
- When in doubt about whether a pull request will be accepted, please first file an issue to discuss it.
All submissions, including submissions by project members, require at least two
reviews. We use GitHub Pull Requests for this purpose.

Before opening a Pull Request, please check if there is not already one open
that aims to solve same problem.

To the extend possible, the pull request process guards our coding guidelines.
Some pointers:

- Checks should be _topical_: Ideally they address a single concern.
- Where possible checks should provide _fixes_, and ideally these are completely
behavior preserving. In order for a check to be adopted by users it must not
"get in the way". So for a check which addresses a relatively trivial
stylistic concern it is doubly important that the violations it detects can be
auto-patched.
- Make sure you have read Error Prone's [criteria for new
checks][error-prone-criteria]. Most guidelines described there apply to this
project as well, except that this project _does_ focus quite heavy on style
enforcement. But that just makes the previous point doubly important.
- Make sure that a check's (mutation) coverage is or remains about as high as it
can be. Not only does this lead to better tests, it also points out
opportunities to simplify the code.
- Please restrict the scope of a pull request to a single feature or fix. Don't
sneak in unrelated changes.
- When in doubt about whether a pull request will be accepted, please first file
an issue to discuss it.

[error-prone-criteria]: https://errorprone.info/docs/criteria
72 changes: 47 additions & 25 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,25 +8,27 @@

# Error Prone Support

Error Prone Support is a Picnic-opinionated extension of [Error Prone][error-prone-repo], a static analysis tool for Java that catches common programming mistakes at compile-time.
Error Prone Support is a Picnic-opinionated extension of [Error
Prone][error-prone-repo] to improve code quality and maintainability.

[![Maven central][maven-badge]][maven-eps]
![GitHub Actions][ci-badge]
[![Licence][licence-badge]][licence]
[![PRs Welcome][pr-badge]][contribute]
> Error Prone is a static analysis tool for Java that catches common programming
> mistakes at compile-time.
[Getting started](#%EF%B8%8F-getting-started)
[How it works](#-how-it-works)
[Building](#-building)
[Contribute](#%EF%B8%8F-contribute)
[![Maven central][maven-badge]][maven-eps] ![GitHub Actions][ci-badge]
[![Licence][licence-badge]][licence] [![PRs Welcome][pr-badge]][contribute]

[Getting started](#%EF%B8%8F-getting-started)[Building](#-building)
[How it works](#-how-it-works)[Contribute](#%EF%B8%8F-contribute)

</div>

---

## ⚡ Getting started

Edit your `pom.xml` file to add Error Prone Support to your project.
Edit your `pom.xml` file to add Error Prone Support to your project. See
[@PicnicSupermarket/oss-parent/pom.xml][oss-parent-example] for an example
configuration.

```xml
<build>
Expand Down Expand Up @@ -59,40 +61,60 @@ Edit your `pom.xml` file to add Error Prone Support to your project.

## 👷 Building

This is a [Maven][maven] project, so running `mvn clean install` performs a
full clean build. Some relevant flags:

- `-Dverification.warn` makes the warnings and errors emitted by various plugins and the Java compiler non-fatal, where possible.
- `-Dverification.skip` disables various non-essential plugins and compiles the code with minimal checks (i.e. without linting, Error Prone checks, etc.)
- `-Dversion.error-prone=some-version` runs the build using the specified version of Error Prone. This is useful e.g. when testing a locally built Error Prone SNAPSHOT.
- `-Perror-prone-fork` run the build using Picnic's [Error Prone fork][error-prone-fork-repo], hosted on [Jitpack][error-prone-fork-jitpack]. This fork generally contains a few changes on top of the latest Error Prone release.
This is a [Maven][maven] project, so running `mvn clean install` performs a full
clean build. Some relevant flags:

- `-Dverification.warn` makes the warnings and errors emitted by various plugins
and the Java compiler non-fatal, where possible.
- `-Dverification.skip` disables various non-essential plugins and compiles the
code with minimal checks (i.e. without linting, Error Prone checks, etc.)
- `-Dversion.error-prone=some-version` runs the build using the specified
version of Error Prone. This is useful e.g. when testing a locally built Error
Prone SNAPSHOT.
- `-Perror-prone-fork` run the build using Picnic's [Error Prone
fork][error-prone-fork-repo], hosted on [Jitpack][error-prone-fork-jitpack].
This fork generally contains a few changes on top of the latest Error Prone
release.

Two other goals that one may find relevant:

- `mvn fmt:format` formats the code using [`google-java-format`][google-java-format].
- `mvn pitest:mutationCoverage` runs mutation tests using [PIT][pitest]. The results can be reviewed by opening the respective `target/pit-reports/index.html` files. For more information check the [PIT Maven plugin][pitest-maven].
- `mvn fmt:format` formats the code using
[`google-java-format`][google-java-format].
- `mvn pitest:mutationCoverage` runs mutation tests using [PIT][pitest]. The
results can be reviewed by opening the respective
`target/pit-reports/index.html` files. For more information check the [PIT
Maven plugin][pitest-maven].

When loading the project in IntelliJ IDEA (and perhaps other IDEs) errors about the inaccessibility of `com.sun.tools.javac.*` classes may be reported. If this happens, configure your IDE to enable the `add-exports` profile.
When loading the project in IntelliJ IDEA (and perhaps other IDEs) errors about
the inaccessibility of `com.sun.tools.javac.*` classes may be reported. If this
happens, configure your IDE to enable the `add-exports` profile.

## 💡 How it works

Extending [@google/error-prone][error-prone-repo].

## ✍️ Contribute

Want to fix a bug, improve the docs, or add a new feature? That's awesome! Please read the [contributing document][contribute].
Want to fix a bug, improve the docs, or add a new feature? That's awesome!
Please read the [contributing document][contribute].

[ci-badge]: https://github.com/PicnicSupermarket/error-prone-support/actions/workflows/build.yaml/badge.svg
[ci-badge]:
https://github.com/PicnicSupermarket/error-prone-support/actions/workflows/build.yaml/badge.svg
[contribute]: CONTRIBUTING.md
[error-prone-fork-jitpack]: https://jitpack.io/#PicnicSupermarket/error-prone
[error-prone-fork-repo]: https://github.com/PicnicSupermarket/error-prone
[error-prone-repo]: https://github.com/google/error-prone
[google-java-format]: https://github.com/google/google-java-format
[licence-badge]: https://img.shields.io/github/license/PicnicSupermarket/error-prone-support
[licence-badge]:
https://img.shields.io/github/license/PicnicSupermarket/error-prone-support
[licence]: LICENSE.md
[maven-badge]: https://img.shields.io/maven-central/v/tech.picnic.error-prone-support/error-prone-support?color=blue
[maven-eps]: https://search.maven.org/artifact/tech.picnic.error-prone-support/error-prone-support
[maven-badge]:
https://img.shields.io/maven-central/v/tech.picnic.error-prone-support/error-prone-support?color=blue
[maven-eps]:
https://search.maven.org/artifact/tech.picnic.error-prone-support/error-prone-support
[maven]: https://maven.apache.org
[oss-parent-example]:
https://github.com/PicnicSupermarket/oss-parent/blob/d2fd86f4f3bd16d92983068eb83995207b2e9631/pom.xml#L1000
[pitest-maven]: https://pitest.org/quickstart/maven
[pitest]: https://pitest.org
[pr-badge]: https://img.shields.io/badge/PRs-welcome-brightgreen.svg

0 comments on commit 0411b68

Please sign in to comment.