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

Bumps sbt org policies version #60

Merged
merged 6 commits into from
Feb 1, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
69 changes: 47 additions & 22 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,39 +1,64 @@
language: scala

dist: precise
sudo: required

scala:
- 2.10.6
- 2.11.11
- 2.12.2

jdk:
- oraclejdk8

scala:
- 2.10.7
- 2.11.12
- 2.12.4

before_install:
- if [ "$TRAVIS_BRANCH" = "master" -a "$TRAVIS_PULL_REQUEST" = "false" ]; then
openssl aes-256-cbc -K $encrypted_1e3c8fda68a9_key -iv $encrypted_1e3c8fda68a9_iv
-in secring.gpg.enc -out secring.gpg -d;
fi
- export PATH=${PATH}:./vendor/bundle
- if [ "$TRAVIS_BRANCH" = "master" -a "$TRAVIS_PULL_REQUEST" = "false" ]; then
openssl aes-256-cbc -K $encrypted_1e3c8fda68a9_key -iv $encrypted_1e3c8fda68a9_iv
-in secring.gpg.enc -out secring.gpg -d;
fi
- export PATH=${PATH}:./vendor/bundle

install:
- rvm use 2.2.3 --install --fuzzy
- gem update --system
- gem install sass
- gem install jekyll -v 3.2.1
- rvm use 2.2.5 --install --fuzzy
- gem update --system
- gem install sass
- gem install ruby_dep -v 1.3.1
- gem install jekyll -v 3.4.3

script:
- sbt ++$TRAVIS_SCALA_VERSION orgScriptCI
- sbt ++$TRAVIS_SCALA_VERSION clean coverage "testOnly * -- -minSuccessfulTests 100000" coverageAggregate coverageReport

stages:
- test
- validation
- deploy

after_success:
- bash <(curl -s https://codecov.io/bash)
- sbt ++$TRAVIS_SCALA_VERSION orgAfterCISuccess
jobs:
include:
- stage: validation
script:
- sbt ++$TRAVIS_SCALA_VERSION orgValidateFiles
- sbt ++$TRAVIS_SCALA_VERSION orgCheckSettings
- sbt ++$TRAVIS_SCALA_VERSION docs/tut
- bash <(curl -s https://codecov.io/bash)
scala: 2.12.4
- stage: deploy
script:
- if [ "$TRAVIS_BRANCH" = "master" -a "$TRAVIS_PULL_REQUEST" = "false" ]; then
if grep -q "SNAPSHOT" version.sbt; then
sbt ++$TRAVIS_SCALA_VERSION publish;
else
sbt orgUpdateDocFiles;
git reset --hard HEAD;
git clean -f;
git checkout master;
git pull origin master;
sbt release;
sbt docs/publishMicrosite;
fi
fi
scala: 2.12.4

cache:
directories:
- $HOME/.sbt/0.13
- $HOME/.sbt/1.0
- $HOME/.sbt/boot/scala*
- $HOME/.sbt/cache
- $HOME/.sbt/launchers
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright 2016-2017 47 Degrees, LLC. <http://www.47deg.com>
* Copyright 2016-2018 47 Degrees, LLC. <http://www.47deg.com>
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright 2016-2017 47 Degrees, LLC. <http://www.47deg.com>
* Copyright 2016-2018 47 Degrees, LLC. <http://www.47deg.com>
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand Down Expand Up @@ -43,14 +43,14 @@ object CombinatorProperties extends Properties("Combinator Generators") {
property("genDistinctTuple should return a pair where the values are never equal") =
forAll(genDistinctPair[Int]) { case (fst, snd) => fst != snd }

property("genOrderedList should return a list in ascending order") =
forAll(genOrderedList[Int]) { list: List[Int] =>
property("genOrderedList should return a list in ascending order") = forAll(genOrderedList[Int]) {
list: List[Int] =>
list.sliding(2, 1).forall {
case h :: t :: Nil => h <= t
case _ :: Nil => true
case _ => false
}
}
}

property("genOrderedList produces empty lists") = exists(genOrderedList[Int]) { _.isEmpty }

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright 2016-2017 47 Degrees, LLC. <http://www.47deg.com>
* Copyright 2016-2018 47 Degrees, LLC. <http://www.47deg.com>
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright 2016-2017 47 Degrees, LLC. <http://www.47deg.com>
* Copyright 2016-2018 47 Degrees, LLC. <http://www.47deg.com>
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright 2016-2017 47 Degrees, LLC. <http://www.47deg.com>
* Copyright 2016-2018 47 Degrees, LLC. <http://www.47deg.com>
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright 2016-2017 47 Degrees, LLC. <http://www.47deg.com>
* Copyright 2016-2018 47 Degrees, LLC. <http://www.47deg.com>
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright 2016-2017 47 Degrees, LLC. <http://www.47deg.com>
* Copyright 2016-2018 47 Degrees, LLC. <http://www.47deg.com>
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright 2016-2017 47 Degrees, LLC. <http://www.47deg.com>
* Copyright 2016-2018 47 Degrees, LLC. <http://www.47deg.com>
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand Down Expand Up @@ -52,7 +52,6 @@ trait GenJdk8 {
object GenJdk8 extends GenJdk8

object ArbitraryJdk8 extends GenJdk8 {
implicit def arbJdk8(
implicit granularity: Granularity[ZonedDateTime]): Arbitrary[ZonedDateTime] =
implicit def arbJdk8(implicit granularity: Granularity[ZonedDateTime]): Arbitrary[ZonedDateTime] =
Arbitrary(genZonedDateTime)
}
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright 2016-2017 47 Degrees, LLC. <http://www.47deg.com>
* Copyright 2016-2018 47 Degrees, LLC. <http://www.47deg.com>
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright 2016-2017 47 Degrees, LLC. <http://www.47deg.com>
* Copyright 2016-2018 47 Degrees, LLC. <http://www.47deg.com>
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright 2016-2017 47 Degrees, LLC. <http://www.47deg.com>
* Copyright 2016-2018 47 Degrees, LLC. <http://www.47deg.com>
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright 2016-2017 47 Degrees, LLC. <http://www.47deg.com>
* Copyright 2016-2018 47 Degrees, LLC. <http://www.47deg.com>
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright 2016-2017 47 Degrees, LLC. <http://www.47deg.com>
* Copyright 2016-2018 47 Degrees, LLC. <http://www.47deg.com>
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright 2016-2017 47 Degrees, LLC. <http://www.47deg.com>
* Copyright 2016-2018 47 Degrees, LLC. <http://www.47deg.com>
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand Down
5 changes: 3 additions & 2 deletions docs/src/main/tut/docs/datetime/granularity.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ layout: docs
---
# Granularity

```tut:invisible
```tut:silent
// this is here to remove noisy warnings
import org.scalacheck.Prop.passed
import org.scalacheck.Prop.forAll
Expand All @@ -25,7 +25,7 @@ When a value is constrained, the time fields are set to zero, and the rest to th

To constrain a generated type, you simply need to provide an import for the typeclass for your date/time and range, and also an import for the granularity. As an example, this time using Java SE 8's `java.time` package:

```tut
```tut:silent
import java.time._
import com.fortysevendeg.scalacheck.datetime.jdk8.ArbitraryJdk8._
import com.fortysevendeg.scalacheck.datetime.instances.jdk8._
Expand All @@ -41,5 +41,6 @@ val prop = forAll { zdt: ZonedDateTime =>
}

prop.check
// + OK, passed 100 tests.
```

5 changes: 3 additions & 2 deletions docs/src/main/tut/docs/datetime/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ There is an expectation of including more date/time and range classes before 1.0

To arbitrarily generate dates and times, you need to have the `Arbitrary` in scope for your date/time class. Assuming Joda Time:

```tut:invisible
```tut:silent
// this is here to remove noisy warnings
import org.scalacheck.Prop.passed
import org.scalacheck.Prop.forAll
Expand All @@ -33,7 +33,7 @@ val range = Period.years(1)

```

```tut
```tut:silent
import org.scalacheck.Prop.forAll
import org.joda.time.DateTime
import com.fortysevendeg.scalacheck.datetime.joda.ArbitraryJoda._
Expand All @@ -44,6 +44,7 @@ val prop = forAll { dt: DateTime =>
}

prop.check
// + OK, passed 100 tests.
```

## A note on imports
Expand Down
10 changes: 5 additions & 5 deletions docs/src/main/tut/docs/datetime/range.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ layout: docs

# Creating Ranges

```tut:invisible
```tut:silent
// this is here to remove noisy warnings
import org.scalacheck.Prop.passed
import org.scalacheck.Prop.forAll
Expand All @@ -16,7 +16,7 @@ You can generate date/time instances only within a certain range, using the `gen

Showing this usage with Joda Time:

```tut
```tut:silent
import org.joda.time._
import com.fortysevendeg.scalacheck.datetime.instances.joda._
import com.fortysevendeg.scalacheck.datetime.GenDateTime.genDateTimeWithinRange
Expand All @@ -29,14 +29,14 @@ val prop = forAll(genDateTimeWithinRange(from, range)) { dt =>
}

prop.check

// + OK, passed 100 tests.
```

# Using Granularity and Ranges Together

As you would expect, it is possible to use the granularity and range concepts together. This example should not show anything surprising by now:

```tut
```tut:silent
import com.fortysevendeg.scalacheck.datetime.instances.joda._
import com.fortysevendeg.scalacheck.datetime.GenDateTime.genDateTimeWithinRange
import com.fortysevendeg.scalacheck.datetime.joda.granularity.days
Expand All @@ -53,5 +53,5 @@ val prop = forAll(genDateTimeWithinRange(from, range)) { dt =>
}

prop.check

// + OK, passed 100 tests.
```
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright 2016-2017 47 Degrees, LLC. <http://www.47deg.com>
* Copyright 2016-2018 47 Degrees, LLC. <http://www.47deg.com>
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright 2016-2017 47 Degrees, LLC. <http://www.47deg.com>
* Copyright 2016-2018 47 Degrees, LLC. <http://www.47deg.com>
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand Down
46 changes: 35 additions & 11 deletions project/ProjectPlugin.scala
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,10 @@ import sbtorgpolicies.model.scalac
import sbtorgpolicies.templates.badges._
import sbtorgpolicies.runnable.syntax._
import sbtorgpolicies.runnable._
import sbtorgpolicies.templates._
import sbtorgpolicies.templates.badges._
import sbtunidoc.ScalaUnidocPlugin.autoImport._
import tut.Plugin._
import tut.TutPlugin.autoImport._

object ProjectPlugin extends AutoPlugin {

Expand Down Expand Up @@ -61,16 +63,38 @@ object ProjectPlugin extends AutoPlugin {
ScalaLangBadge.apply(_),
GitHubIssuesBadge.apply(_)
),
orgScriptTaskListSetting := List(
orgValidateFiles.asRunnableItem,
orgCheckSettings.asRunnableItem,
(clean in Global).asRunnableItemFull,
SetSetting(coverageEnabled in Global, true).asRunnableItem,
(compile in Compile).asRunnableItemFull,
"test-only * -- -minSuccessfulTests 100000".asRunnableItemFull,
(ScoverageKeys.coverageReport in Test).asRunnableItemFull,
(tut in ProjectRef(file("."), "docs")).asRunnableItem,
"docs/unidoc".asRunnableItemFull
orgEnforcedFilesSetting := List(
LicenseFileType(orgGithubSetting.value, orgLicenseSetting.value, startYear.value),
ContributingFileType(
orgProjectName.value,
// Organization field can be configured with default value if we migrate it to the frees-io organization
orgGithubSetting.value.copy(project = "freestyle")),
AuthorsFileType(
name.value,
orgGithubSetting.value,
orgMaintainersSetting.value,
orgContributorsSetting.value),
NoticeFileType(
orgProjectName.value,
orgGithubSetting.value,
orgLicenseSetting.value,
startYear.value),
VersionSbtFileType,
ChangelogFileType,
ReadmeFileType(
orgProjectName.value,
orgGithubSetting.value,
startYear.value,
orgLicenseSetting.value,
orgCommitBranchSetting.value,
sbtPlugin.value,
name.value,
version.value,
scalaBinaryVersion.value,
sbtBinaryVersion.value,
orgSupportedScalaJSVersion.value,
orgBadgeListSetting.value
)
)
)
}
2 changes: 1 addition & 1 deletion project/build.properties
Original file line number Diff line number Diff line change
@@ -1 +1 @@
sbt.version=0.13.15
sbt.version=1.0.4
2 changes: 1 addition & 1 deletion project/plugins.sbt
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
resolvers += Resolver.sonatypeRepo("releases")
addSbtPlugin("com.47deg" % "sbt-org-policies" % "0.4.18")
addSbtPlugin("com.47deg" % "sbt-org-policies" % "0.8.24")
2 changes: 1 addition & 1 deletion version.sbt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
version in ThisBuild := "0.2.4-SNAPSHOT"
version in ThisBuild := "0.2.4"