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

License derived from .baseline/copyright #1217

Merged
merged 19 commits into from
Feb 10, 2020
Merged

Conversation

dansanduleac
Copy link
Contributor

@dansanduleac dansanduleac commented Feb 6, 2020

Before this PR

Enforcing copyright file using checkstyle which is hard to change and not in sync with whatever files are in .baseline/copyright.

After this PR

==COMMIT_MSG==
Enforcing copyright based on the first file (lexicographically) founds in .baseline/copyright.

This now uses spotless, which means that we can now autofix all copyrights using gradle.

It also allows us to enforce this copyright on groovy files, which we didn't have before.
==COMMIT_MSG==

Possible downsides?

  • the copyright at the top of all (java, groovy) files must be identical (except the year) or else it will get rewritten
  • it might make it more difficult to deal with copied files that had another license already on them
    • can deal with it by having two comments, the standard repo one, and then another one with the original attribution

@changelog-app
Copy link

changelog-app bot commented Feb 6, 2020

Generate changelog in changelog/@unreleased

Type

  • Feature
  • Improvement
  • Fix
  • Break
  • Deprecation
  • Manual task
  • Migration

Description

Enforcing copyright based on the first file (lexicographically) founds in .baseline/copyright.

Check the box to generate changelog(s)

  • Generate changelog entry

@policy-bot policy-bot bot requested a review from iamdanfox February 6, 2020 15:19
@dansanduleac dansanduleac changed the title Ds/copyright spotless License derived from .baseline/copyright Feb 6, 2020
@iamdanfox
Copy link
Contributor

Looks cool, might be worth a mention in the README that the copyright directory is important, and that running ./gradlew spotlessApply should fix things :)


To automatically update all files with mismatching/missing copyrights, run `./gradlew format`.
Copy link
Contributor

Choose a reason for hiding this comment

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

./gradlew format feels a bit odd here. I think I'd almost recommend spotlessApply here

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Isn't it the same thing though?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Recommending another command that format intentionally aliases feels like it might confuse people.

@iamdanfox
Copy link
Contributor

So running this internally on sls-logging, it seems it currently wrecks the world (and replaces our internal shorthand license with the apache one, which isn't correct). Think we need to:

  • ensure this task tolerates any of the templatets in the .baseline/copyright dir
  • prefers the highest prefix (not lowest)
  • probably update excavator to delete the apache license template from internal repos (as internal code is not apache license by default!)

This was referenced Feb 10, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants