Skip to content

Commit 8a69f5c

Browse files
committed
Use 30 days instead of @monthly in repo config example
This changes the value of the `pullRequests.frequency` config in the example to slow down future updates in PR bodies from `@monthly` (which is an alias for `30 days`) to `30 days`. An advantage of this new value is that it is immediately clear how it needs to be adapted if you want to receive updates every 7, 14, 60, etc. days. With `@monthly` you need to look at the documentation to learn what other special values exists and how to configure a custom frequency of every n days.
1 parent 86ad84a commit 8a69f5c

File tree

4 files changed

+14
-9
lines changed

4 files changed

+14
-9
lines changed

modules/core/src/main/scala/org/scalasteward/core/repoconfig/GroupRepoConfig.scala

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,12 +38,12 @@ object GroupRepoConfig {
3838
val forUpdate: Update.Single => String = {
3939
case s: Update.ForArtifactId =>
4040
s"""{
41-
| pullRequests = { frequency = "@monthly" },
41+
| pullRequests = { frequency = "30 days" },
4242
| dependency = { groupId = "${s.groupId}", artifactId = "${s.artifactId.name}" }
4343
|}""".stripMargin
4444
case g: Update.ForGroupId =>
4545
s"""{
46-
| pullRequests = { frequency = "@monthly" },
46+
| pullRequests = { frequency = "30 days" },
4747
| dependency = { groupId = "${g.groupId}" }
4848
|}""".stripMargin
4949
}

modules/core/src/test/scala/org/scalasteward/core/forge/data/NewPullRequestDataTest.scala

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ class NewPullRequestDataTest extends FunSuite {
3030
val expected =
3131
raw"""|{
3232
| "title" : "Update logback-classic to 1.2.3",
33-
| "body" : "Updates ch.qos.logback:logback-classic from 1.2.0 to 1.2.3.\n\n\nI'll automatically update this PR to resolve conflicts as long as you don't change it yourself.\n\nIf you'd like to skip this version, you can just close this PR. If you have any feedback, just mention me in the comments below.\n\nConfigure Scala Steward for your repository with a [`.scala-steward.conf`](https://github.com/scala-steward-org/scala-steward/blob/${org.scalasteward.core.BuildInfo.gitHeadCommit}/docs/repo-specific-configuration.md) file.\n\nHave a fantastic day writing Scala!\n\n<details>\n<summary>Adjust future updates</summary>\n\nAdd this to your `.scala-steward.conf` file to ignore future updates of this dependency:\n```\nupdates.ignore = [ { groupId = \"ch.qos.logback\", artifactId = \"logback-classic\" } ]\n```\nOr, add this to slow down future updates of this dependency:\n```\ndependencyOverrides = [{\n pullRequests = { frequency = \"@monthly\" },\n dependency = { groupId = \"ch.qos.logback\", artifactId = \"logback-classic\" }\n}]\n```\n</details>\n\nlabels: library-update, early-semver-patch, semver-spec-patch, commit-count:0",
33+
| "body" : "Updates ch.qos.logback:logback-classic from 1.2.0 to 1.2.3.\n\n\nI'll automatically update this PR to resolve conflicts as long as you don't change it yourself.\n\nIf you'd like to skip this version, you can just close this PR. If you have any feedback, just mention me in the comments below.\n\nConfigure Scala Steward for your repository with a [`.scala-steward.conf`](https://github.com/scala-steward-org/scala-steward/blob/${org.scalasteward.core.BuildInfo.gitHeadCommit}/docs/repo-specific-configuration.md) file.\n\nHave a fantastic day writing Scala!\n\n<details>\n<summary>Adjust future updates</summary>\n\nAdd this to your `.scala-steward.conf` file to ignore future updates of this dependency:\n```\nupdates.ignore = [ { groupId = \"ch.qos.logback\", artifactId = \"logback-classic\" } ]\n```\nOr, add this to slow down future updates of this dependency:\n```\ndependencyOverrides = [{\n pullRequests = { frequency = \"30 days\" },\n dependency = { groupId = \"ch.qos.logback\", artifactId = \"logback-classic\" }\n}]\n```\n</details>\n\nlabels: library-update, early-semver-patch, semver-spec-patch, commit-count:0",
3434
| "head" : "scala-steward:update/logback-classic-1.2.3",
3535
| "base" : "master",
3636
| "labels" : [
@@ -61,7 +61,7 @@ class NewPullRequestDataTest extends FunSuite {
6161
val expected =
6262
raw"""|{
6363
| "title" : "Update logback-classic to 1.2.3",
64-
| "body" : "Updates ch.qos.logback:logback-classic from 1.2.0 to 1.2.3.\n\n\nI'll automatically update this PR to resolve conflicts as long as you don't change it yourself.\n\nIf you'd like to skip this version, you can just close this PR. If you have any feedback, just mention me in the comments below.\n\nConfigure Scala Steward for your repository with a [`.scala-steward.conf`](https://github.com/scala-steward-org/scala-steward/blob/${org.scalasteward.core.BuildInfo.gitHeadCommit}/docs/repo-specific-configuration.md) file.\n\nHave a fantastic day writing Scala!\n\n<details>\n<summary>Adjust future updates</summary>\n\nAdd this to your `.scala-steward.conf` file to ignore future updates of this dependency:\n```\nupdates.ignore = [ { groupId = \"ch.qos.logback\", artifactId = \"logback-classic\" } ]\n```\nOr, add this to slow down future updates of this dependency:\n```\ndependencyOverrides = [{\n pullRequests = { frequency = \"@monthly\" },\n dependency = { groupId = \"ch.qos.logback\", artifactId = \"logback-classic\" }\n}]\n```\n</details>\n<details>\n<summary>Note that the Scala Steward config file `.scala-steward.conf` wasn't parsed correctly</summary>\n\n```\nFailed to parse .scala-steward.conf\n```\n</details>\n\nlabels: library-update, early-semver-patch, semver-spec-patch, commit-count:0",
64+
| "body" : "Updates ch.qos.logback:logback-classic from 1.2.0 to 1.2.3.\n\n\nI'll automatically update this PR to resolve conflicts as long as you don't change it yourself.\n\nIf you'd like to skip this version, you can just close this PR. If you have any feedback, just mention me in the comments below.\n\nConfigure Scala Steward for your repository with a [`.scala-steward.conf`](https://github.com/scala-steward-org/scala-steward/blob/${org.scalasteward.core.BuildInfo.gitHeadCommit}/docs/repo-specific-configuration.md) file.\n\nHave a fantastic day writing Scala!\n\n<details>\n<summary>Adjust future updates</summary>\n\nAdd this to your `.scala-steward.conf` file to ignore future updates of this dependency:\n```\nupdates.ignore = [ { groupId = \"ch.qos.logback\", artifactId = \"logback-classic\" } ]\n```\nOr, add this to slow down future updates of this dependency:\n```\ndependencyOverrides = [{\n pullRequests = { frequency = \"30 days\" },\n dependency = { groupId = \"ch.qos.logback\", artifactId = \"logback-classic\" }\n}]\n```\n</details>\n<details>\n<summary>Note that the Scala Steward config file `.scala-steward.conf` wasn't parsed correctly</summary>\n\n```\nFailed to parse .scala-steward.conf\n```\n</details>\n\nlabels: library-update, early-semver-patch, semver-spec-patch, commit-count:0",
6565
| "head" : "scala-steward:update/logback-classic-1.2.3",
6666
| "base" : "master",
6767
| "labels" : [
@@ -384,11 +384,11 @@ class NewPullRequestDataTest extends FunSuite {
384384
|```
385385
|dependencyOverrides = [
386386
| {
387-
| pullRequests = { frequency = "@monthly" },
387+
| pullRequests = { frequency = "30 days" },
388388
| dependency = { groupId = "a", artifactId = "b" }
389389
| },
390390
| {
391-
| pullRequests = { frequency = "@monthly" },
391+
| pullRequests = { frequency = "30 days" },
392392
| dependency = { groupId = "c", artifactId = "d" }
393393
| }
394394
|]
@@ -442,11 +442,11 @@ class NewPullRequestDataTest extends FunSuite {
442442
|```
443443
|dependencyOverrides = [
444444
| {
445-
| pullRequests = { frequency = \"@monthly\" },
445+
| pullRequests = { frequency = \"30 days\" },
446446
| dependency = { groupId = \"ch.qos.logback\", artifactId = \"logback-classic\" }
447447
| },
448448
| {
449-
| pullRequests = { frequency = \"@monthly\" },
449+
| pullRequests = { frequency = \"30 days\" },
450450
| dependency = { groupId = \"com.example\", artifactId = \"foo\" }
451451
| }
452452
|]

modules/core/src/test/scala/org/scalasteward/core/nurture/NurtureAlgTest.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ class NurtureAlgTest extends CatsEffectSuite with Http4sDsl[MockEff] {
5959
|Or, add this to slow down future updates of this dependency:
6060
|```
6161
|dependencyOverrides = [{
62-
| pullRequests = { frequency = "@monthly" },
62+
| pullRequests = { frequency = "30 days" },
6363
| dependency = { groupId = "org.typelevel", artifactId = "cats-effect" }
6464
|}]
6565
|```

modules/core/src/test/scala/org/scalasteward/core/util/dateTimeTest.scala

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,11 @@ class dateTimeTest extends ScalaCheckSuite {
2727
assert(clue(parseFiniteDuration("Inf").isLeft))
2828
}
2929

30+
test("parseFiniteDuration: examples") {
31+
assertEquals(parseFiniteDuration("30days"), Right(30.days))
32+
assertEquals(parseFiniteDuration("30 days"), Right(30.days))
33+
}
34+
3035
test("showDuration: example 1") {
3136
val d = 2.days + 20.hours + 37.minutes + 3.seconds + 586.millis + 491.micros + 264.nanos
3237
assertEquals(showDuration(d), "2d 20h 37m")

0 commit comments

Comments
 (0)