Skip to content

Conversation

@raboof
Copy link
Contributor

@raboof raboof commented Nov 17, 2017

Could be used to implement #23

Just a sketch for feedback, if the general approach looks OK I'll add tests and look more closely at binary compatibility.

@hseeberger
Copy link
Member

Thanks!

Sorry to ask, but what would be the exact effect of this change?

@raboof
Copy link
Contributor Author

raboof commented Nov 19, 2017

Of course! The main change is that this unseals CommentCreator so users can provide their own.

Additionally, it adds a existingText: Option[String] parameter to CommentCreator.apply, so that you can optionally take into account the existing header text.

This can be used to make sure the copyright year is preserved. I can provide a crude regex-based implementation of that as a unit test, though doing it 'really correctly' might be hard so I'm not proposing adding such an implementation to the plugin itself just yet :).

@hseeberger
Copy link
Member

@raboof, thanks, LGTM.

@britter, what do you as the creator of commentcreator think?

Via HeaderCreator and CommentCreator
@hseeberger
Copy link
Member

Nice!

Copy link
Contributor

@britter britter left a comment

Choose a reason for hiding this comment

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

LGTM

@hseeberger hseeberger merged commit 7ff2d1d into sbt:master Nov 24, 2017
@hseeberger hseeberger added this to the 5.0.0 milestone Feb 20, 2018
krchniam pushed a commit to krchniam/sbt-header that referenced this pull request Jul 2, 2018
…g header (sbt#142)

* Allow taking into account the existing header when adding a new one

* Add test preserving copyright year

Via HeaderCreator and CommentCreator

* Add documentation
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.

3 participants