typelevel / scalacheck

Property-based testing for Scala
http://www.scalacheck.org
BSD 3-Clause "New" or "Revised" License
1.94k stars 405 forks source link

Integrate sbt-header (via sbt-typelevel) #959

Closed satorg closed 1 year ago

satorg commented 1 year ago

This PR should technically precede #950. Initially my intent was to just introduce scalafmt in here, but then I realized that it would be easier if we would have the sbt-header incorporated first. So here this PR is.

A couple of things to mention:

  1. Most of the source files had their own headers already which do not correspond to any of the standard headers that sbt-header provides out of the box. So I created a custom header which is just a copy of the original one, but uses an sbt-header default style. See project/CustomHeaderPlugin.scala.
  2. The sbt-header does not cover source files that are loaded into and used by SBT directly (i.e. those located in the project dir). However, scalacheck has project/codegen.scala along with the aforementioned CustomHeaderPlugin.scala. So I plugged them in to the sbt-header in build.sbt (see settings for the root project).
  3. For the full version of sbt-typelevel the .scalafmt.conf should exist. So I created one but disabled any formatting in it for now. I think, it'd still be better to enable it in a separate follow up PR.
satorg commented 1 year ago

Need to work out CI build errors, so converting to Draft for now :(

rossabaker commented 1 year ago

The approach seems fine to me, but if it simplifies things, I think the important factors is that Rickard maintains the copyright and the BSD3 license is preserved. If there's a built-in config that satisfies that, it seems alright to me.

satorg commented 1 year ago

The approach seems fine to me, but if it simplifies things, I think the important factors is that Rickard maintains the copyright and the BSD3 license is preserved. If there's a built-in config that satisfies that, it seems alright to me.

There's BSD3 build-in header for sure, but it does not have any mention regards to Rickard.

My reasoning is that the current approach I'm suggesting does not make things worse – i.e. it incorporates sbt-header, but still keeps the headers the same way. So that we can work out the exact headers content in one of the follow up steps.

So basically I'm just trying to eat that mammoth up in parts rather than trying to swallow the whole thing at once :)

satorg commented 1 year ago

Seems good to go now.