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

First steps to make a utils library #30

Merged
merged 4 commits into from
Jan 12, 2017
Merged

Conversation

noelmarkham
Copy link
Collaborator

Restructuring the project into three (four actually) distinct projects:

  • scalacheck-datetime - the one we know and love
  • magic - inclusion of generators for "magic" strings (drop database STUDENTS etc)
  • combinators - generators for common use-cases (ie, a map and a list of elements guaranteed to be in the map)
  • docs - the fourth project, which is for the Jekyll site

magic and combinators are still in a skeleton form for this PR.

Also todo following this PR is the renaming in Github, docs and elsewhere to reflect use as a utils library rather than just datetime.

@raulraja would you be able to take a look please?

Copy link
Contributor

@raulraja raulraja left a comment

Choose a reason for hiding this comment

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

LGTM!, great stuff! We should make sure we address the fact that the microsite no longers point to just one library but a utils based one with multiple modules. We should consider also renaming the repo.

@@ -2,10 +2,10 @@ import com.typesafe.sbt.SbtGhPages.ghpages
import com.typesafe.sbt.SbtGit.git
import de.heikoseeberger.sbtheader.HeaderPattern

lazy val buildSettings = Seq(
lazy val commonSettings = Seq(
organization := "com.fortysevendeg",
Copy link
Contributor

Choose a reason for hiding this comment

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

Starting now and going forward we are gonna use com.47deg as the org name and groupId for all libs going forward. Existing libs will be migrated over as next releases happen to bring all the OS 47 libs under the same groupId. Once you are ready to publish to sonatype and central, let @fedefernandez and I know and we'll let you when ready. We need to request the org with the first lib that makes there. /cc @andyscott

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I'll leave this in place here and add a ticket to address this before any future releases


val magicStrings: Gen[String] = oneOf(strings)

implicit val enhancedStringArbitrary: Arbitrary[String] = Arbitrary {
Copy link
Contributor

Choose a reason for hiding this comment

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

I wonder if for cases like this one where we are explicitly overriding the scalacheck default instance for Arbitrary[String] an alternative approach would be to use tagged types so it's explicit that we are summoning the implicit for magic Strings. Arbitrary[String @@ Magic]

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I'll have a think about this. In my head the reasoning is you want arbitrary Strings, and just have the added bonus benefit of checking some magic ones too. I see having an import to override the scalacheck default is essentially the same as tagging.

@noelmarkham
Copy link
Collaborator Author

Thanks!

Re the microsite changes, I'll do this in a separate PR before a release.

@noelmarkham noelmarkham merged commit df74c57 into master Jan 12, 2017
@noelmarkham noelmarkham deleted the nm-24-utils-library branch January 18, 2017 16:07
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