Skip to content

Commit 50df298

Browse files
author
Ender Tunc
committed
run sbt docs/mdoc and add small update in tests for --gitlab-remove-source-branch
1 parent d2c7bd7 commit 50df298

File tree

2 files changed

+7
-1
lines changed

2 files changed

+7
-1
lines changed

docs/help.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ All command line arguments for the `scala-steward` application.
55
```
66
Usage:
77
scala-steward validate-repo-config
8-
scala-steward --workspace <file> --repos-file <file> [--git-author-name <string>] --git-author-email <string> [--git-author-signing-key <string>] --git-ask-pass <file> [--sign-commits] [--forge-type <forge-type>] [--forge-api-host <uri>] --forge-login <string> [--do-not-fork] [--add-labels] [--ignore-opts-files] [--env-var <name=value>]... [--process-timeout <duration>] [--whitelist <string>]... [--read-only <string>]... [--enable-sandbox | --disable-sandbox] [--max-buffer-size <integer>] [--repo-config <uri>]... [--disable-default-repo-config] [--scalafix-migrations <uri>]... [--disable-default-scalafix-migrations] [--artifact-migrations <uri>]... [--disable-default-artifact-migrations] [--cache-ttl <duration>] [--bitbucket-use-default-reviewers] [--bitbucket-server-use-default-reviewers] [--gitlab-merge-when-pipeline-succeeds] [--gitlab-required-reviewers <integer>] [--gitlab-remove-source-branch] [--azure-repos-organization <string>] [--github-app-id <integer> --github-app-key-file <file>] [--url-checker-test-url <uri>]... [--default-maven-repo <string>] [--refresh-backoff-period <duration>]
8+
scala-steward --workspace <file> --repos-file <file> [--git-author-name <string>] --git-author-email <string> [--git-author-signing-key <string>] --git-ask-pass <file> [--sign-commits] [--forge-type <forge-type>] [--forge-api-host <uri>] --forge-login <string> [--do-not-fork] [--add-labels] [--ignore-opts-files] [--env-var <name=value>]... [--process-timeout <duration>] [--whitelist <string>]... [--read-only <string>]... [--enable-sandbox | --disable-sandbox] [--max-buffer-size <integer>] [--repo-config <uri>]... [--disable-default-repo-config] [--scalafix-migrations <uri>]... [--disable-default-scalafix-migrations] [--artifact-migrations <uri>]... [--disable-default-artifact-migrations] [--cache-ttl <duration>] [--bitbucket-use-default-reviewers] [--bitbucket-server-use-default-reviewers] [--gitlab-merge-when-pipeline-succeeds] [--gitlab-required-reviewers <integer>] [--merge-request-level-approval-rule <approvals_rule_name=required_approvals>]... [--gitlab-remove-source-branch] [--azure-repos-organization <string>] [--github-app-id <integer> --github-app-key-file <file>] [--url-checker-test-url <uri>]... [--default-maven-repo <string>] [--refresh-backoff-period <duration>]
99
1010
1111
@@ -80,6 +80,8 @@ Options and flags:
8080
Whether to merge a gitlab merge request when the pipeline succeeds
8181
--gitlab-required-reviewers <integer>
8282
When set, the number of required reviewers for a merge request will be set to this number (non-negative integer). Is only used in the context of gitlab-merge-when-pipeline-succeeds being enabled, and requires that the configured access token have the appropriate privileges. Also requires a Gitlab Premium subscription.
83+
--merge-request-level-approval-rule <approvals_rule_name=required_approvals>
84+
Additional repo config file (can be used multiple times)
8385
--gitlab-remove-source-branch
8486
Flag indicating if a merge request should remove the source branch when merging.
8587
--azure-repos-organization <string>

modules/core/src/test/scala/org/scalasteward/core/application/CliTest.scala

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -157,22 +157,26 @@ class CliTest extends FunSuite {
157157
test("parseArgs: non-default GitLab arguments and required reviewers") {
158158
val params = minimumRequiredParams ++ List(
159159
List("--gitlab-merge-when-pipeline-succeeds"),
160+
List("--gitlab-remove-source-branch"),
160161
List("--gitlab-required-reviewers", "5")
161162
)
162163
val Success(StewardUsage.Regular(obtained)) = Cli.parseArgs(params.flatten)
163164

164165
assert(obtained.gitLabCfg.mergeWhenPipelineSucceeds)
166+
assert(obtained.gitLabCfg.removeSourceBranch)
165167
assertEquals(obtained.gitLabCfg.requiredApprovals, Some(5.asLeft))
166168
}
167169

168170
test("parseArgs: non-default GitLab arguments and merge request level approval rule") {
169171
val params = minimumRequiredParams ++ List(
170172
List("--gitlab-merge-when-pipeline-succeeds"),
173+
List("--gitlab-remove-source-branch"),
171174
List("--merge-request-level-approval-rule", "All eligible users:0")
172175
)
173176
val Success(StewardUsage.Regular(obtained)) = Cli.parseArgs(params.flatten)
174177

175178
assert(obtained.gitLabCfg.mergeWhenPipelineSucceeds)
179+
assert(obtained.gitLabCfg.removeSourceBranch)
176180
assertEquals(
177181
obtained.gitLabCfg.requiredApprovals,
178182
Some(Nel.one(MergeRequestApprovalRulesCfg("All eligible users", 0)).asRight)

0 commit comments

Comments
 (0)