Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[build] Use Spotless plugin to enforce/update copyright headers #2729

Merged
merged 3 commits into from
Jun 30, 2021

Conversation

simonbasle
Copy link
Member

@simonbasle simonbasle commented Jun 28, 2021

This only applies to .java files changed compared to the origin base
branch (3.3.x), and excluding JDK stubs.

This allows to enforce license header with up-to-date end year only when
a file get touched (no need for a big bang update of the end year in
all files comes new year).

The year variable in the template is compatible with IntelliJ's own
template format (velocity), although IntelliJ doesn't typically include
the comment characters like in the added template file.

The template includes 2 blank lines at the end so that one blank line
remains after the license header once spotless is applied.

The ratchet (apply spotless only to files that changed between current
commit and the specified branch) is adapted depending on local build,
CI build without any specific parameter and CI build explicitly intended
for spotless (thanks to -PspotlessFrom=branch). The later is necessary
because spotless needs a full checkout, which is typically not done by
default by CI platforms like GitHub Actions.

See reactor/reactor#701

See also reactor/reactor#700 for the initial goal of including basic
formatting.

@simonbasle simonbasle added this to the 3.3.19.RELEASE milestone Jun 28, 2021
@simonbasle simonbasle requested a review from a team as a code owner June 28, 2021 15:23
@simonbasle simonbasle added the type/chores A task not related to code (build, formatting, process, ...) label Jun 28, 2021
@simonbasle simonbasle self-assigned this Jun 28, 2021
@simonbasle simonbasle requested a review from a team June 28, 2021 15:23
This only applies to .java files changed compared to the origin base
branch (3.3.x), and excluding JDK stubs.

This allows to enforce license header with up-to-date end year only when
a file get touched (no need for a big bang update of the end year in
all files comes new year).

The year variable in the template is compatible with IntelliJ's own
template format (velocity), although IntelliJ doesn't typically include
the comment characters like in the added template file.

The template includes 2 blank lines at the end so that one blank line
remains after the license header once spotless is applied.

The ratchet (apply spotless only to files that changed between current
commit and the specified branch) is adapted depending on local build,
CI build without any specific parameter and CI build explicitly intended
for spotless (thanks to `-PspotlessFrom=branch`). The later is necessary
because spotless needs a full checkout, which is typically not done by
default by CI platforms like GitHub Actions.
@simonbasle simonbasle force-pushed the spotlessCopyrightOnly branch from 6d2f4ab to c4f40f2 Compare June 29, 2021 14:14
@simonbasle simonbasle changed the title Add spotless plugin and enforce header for java files [build] Use Spotless plugin to enforce/update copyright headers Jun 30, 2021
@simonbasle
Copy link
Member Author

mmh actually, I'll revert the rename of the job so that there is continuity in the "required checks" of github actions

@simonbasle simonbasle merged commit 4f18a4d into 3.3.x Jun 30, 2021
@reactorbot
Copy link

@simonbasle this PR seems to have been merged on a maintenance branch, please ensure the change is merge-forwarded to intermediate maintenance branches and up to main 🙇

@simonbasle simonbasle deleted the spotlessCopyrightOnly branch June 30, 2021 15:21
simonbasle added a commit that referenced this pull request Jun 30, 2021
Changed the default branch to `main` for ratchet.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type/chores A task not related to code (build, formatting, process, ...)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants