Skip to content

Add maven support for git-based copyright headers#626

Merged
nedtwigg merged 8 commits intomainfrom
feat/maven-licenseyear-githistory
Jun 30, 2020
Merged

Add maven support for git-based copyright headers#626
nedtwigg merged 8 commits intomainfrom
feat/maven-licenseyear-githistory

Conversation

@nedtwigg
Copy link
Copy Markdown
Member

Please make sure that your PR allows edits from maintainers. Sometimes its faster for us to just fix something than it is to describe how to fix it.

Allow edits from maintainers

After creating the PR, please add a commit that adds a bullet-point under the -SNAPSHOT section of CHANGES.md, plugin-gradle/CHANGES.md, and plugin-maven/CHANGES.md which includes:

  • a summary of the change
  • either
    • a link to the issue you are resolving (for small changes)
    • a link to the PR you just created (for big changes likely to have discussion)

If your change only affects a build plugin, and not the lib, then you only need to update the CHANGES.md for that plugin.

If your change affects lib in an end-user-visible way (fixing a bug, updating a version) then you need to update CHANGES.md for both the lib and the build plugins. Users of a build plugin shouldn't have to refer to lib to see changes that affect them.

This makes it easier for the maintainers to quickly release your changes :)

@nedtwigg nedtwigg requested a review from lutovich June 29, 2020 18:25
@nedtwigg
Copy link
Copy Markdown
Member Author

This is the last PR in this train, I'll cut releases of everything once this gets merged.

Comment thread plugin-maven/CHANGES.md Outdated
private String filePatterns;

@Parameter(property = LicenseHeaderStep.spotlessSetLicenseHeaderYearsFromGitHistory)
private String setLicenseHeaderYearsFromGitHistory;
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can this field/parameter be boolean instead of string?
I think this could simplify type signatures (boolean instead of Optional<String>) and the check in LicenseHeader

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think there's a decent chance that we'll allow values besides "true" in the future. For example, you might want to exclude certain commits, say formatting commits, from the git history that you care about, and this is the pipe that we'll put that through.

Comment thread plugin-maven/src/main/java/com/diffplug/spotless/maven/generic/LicenseHeader.java Outdated
@nedtwigg nedtwigg merged commit ba3c126 into main Jun 30, 2020
@nedtwigg nedtwigg deleted the feat/maven-licenseyear-githistory branch June 30, 2020 03:50
@nedtwigg
Copy link
Copy Markdown
Member Author

nedtwigg commented Jul 2, 2020

Published in maven 2.0.0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants