Skip to content

Commit 9c228c6

Browse files
committed
NIT refactor using directives usage in directives, options & docs
- get rid of unnecessary commas and double quote escapes - bump versions where applicable - misc typo fixes & tweaks
1 parent 0a30b3e commit 9c228c6

33 files changed

+124
-123
lines changed

modules/cli/src/main/scala/scala/cli/commands/test/TestOptions.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ object TestOptions {
5353
|A source file is treated as a test source if:
5454
| - the file name ends with `.test.scala`
5555
| - the file comes from a directory that is provided as input, and the relative path from that file to its original directory contains a `test` directory
56-
| - it contains the `//> using target.scope "test"` directive (Experimental)
56+
| - it contains the `//> using target.scope test` directive (Experimental)
5757
|
5858
|${HelpMessages.commandConfigurations(cmdName)}
5959
|

modules/directives/src/main/scala/scala/build/preprocessing/directives/Dependency.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ import scala.cli.commands.SpecificationLevel
2222
@DirectiveExamples("//> using test.dep org.scalatest::scalatest:3.2.10")
2323
@DirectiveExamples("//> using test.dep org.scalameta::munit:0.7.29")
2424
@DirectiveExamples(
25-
"//> using dep \"tabby:tabby:0.2.3,url=https://github.com/bjornregnell/tabby/releases/download/v0.2.3/tabby_3-0.2.3.jar\""
25+
"//> using dep tabby:tabby:0.2.3,url=https://github.com/bjornregnell/tabby/releases/download/v0.2.3/tabby_3-0.2.3.jar"
2626
)
2727
@DirectiveUsage(
2828
"//> using dep org:name:ver | //> using deps org:name:ver org2:name2:ver2",

modules/directives/src/main/scala/scala/build/preprocessing/directives/Exclude.scala

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,8 @@ import scala.util.Try
1111

1212
@DirectiveGroupName("Exclude sources")
1313
@DirectiveExamples("//> using exclude utils.scala")
14-
@DirectiveExamples("//> using exclude \"examples/*\" \"*/resources/*\"")
15-
@DirectiveExamples("//> using exclude \"*.sc\"")
14+
@DirectiveExamples("//> using exclude examples/* */resources/*")
15+
@DirectiveExamples("//> using exclude *.sc")
1616
@DirectiveUsage(
1717
"`//> using exclude `_pattern_ | `//> using exclude `_pattern_ _pattern_ …",
1818
"""`//> using exclude` _pattern_

modules/directives/src/main/scala/scala/build/preprocessing/directives/JavaOptions.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ import scala.build.{Positioned, options}
88
import scala.cli.commands.SpecificationLevel
99

1010
@DirectiveGroupName("Java options")
11-
@DirectiveExamples("//> using javaOpt -Xmx2g, -Dsomething=a")
11+
@DirectiveExamples("//> using javaOpt -Xmx2g -Dsomething=a")
1212
@DirectiveExamples("//> using test.javaOpt -Dsomething=a")
1313
@DirectiveUsage(
1414
"//> using javaOpt _options_",

modules/directives/src/main/scala/scala/build/preprocessing/directives/JavaProps.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ import scala.build.{Positioned, options}
99
import scala.cli.commands.SpecificationLevel
1010

1111
@DirectiveGroupName("Java properties")
12-
@DirectiveExamples("//> using javaProp foo1=bar, foo2")
12+
@DirectiveExamples("//> using javaProp foo1=bar foo2")
1313
@DirectiveExamples("//> using test.javaProp foo3=bar foo4")
1414
@DirectiveUsage(
1515
"//> using javaProp _key=val_",

modules/directives/src/main/scala/scala/build/preprocessing/directives/RequirePlatform.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ import scala.cli.commands.SpecificationLevel
1111
@DirectivePrefix("target.")
1212
@DirectiveDescription("Require a Scala platform for the current file")
1313
@DirectiveExamples("//> using target.platform scala-js")
14-
@DirectiveExamples("//> using target.platform scala-js, scala-native")
14+
@DirectiveExamples("//> using target.platform scala-js scala-native")
1515
@DirectiveExamples("//> using target.platform jvm")
1616
@DirectiveUsage(
1717
"//> using target.platform _platform_",

modules/directives/src/main/scala/scala/build/preprocessing/directives/ScalaVersion.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ import scala.cli.commands.SpecificationLevel
1010
@DirectiveExamples("//> using scala 3.0.2")
1111
@DirectiveExamples("//> using scala 2.13")
1212
@DirectiveExamples("//> using scala 2")
13-
@DirectiveExamples("//> using scala 2.13.6, 2.12.16")
13+
@DirectiveExamples("//> using scala 2.13.6 2.12.16")
1414
@DirectiveUsage(
1515
"//> using scala _version_+",
1616
"`//> using scala` _version_+"

modules/directives/src/main/scala/scala/build/preprocessing/directives/Sources.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ import scala.util.Try
1212
@DirectiveGroupName("Custom sources")
1313
@DirectiveExamples("//> using file utils.scala")
1414
@DirectiveUsage(
15-
"`//> using file `_path_ | `//> using files `_path1_, _path2_ …",
15+
"`//> using file `_path_ | `//> using files `_path1_ _path2_ …",
1616
"""`//> using file` _path_
1717
|
1818
|`//> using files` _path1_ _path2_ …

website/docs/commands/compile.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ For a full list of options, run `scala-cli compile --help`, or check the options
3131
`--test` makes Scala CLI compile main and test scopes:
3232

3333
```scala title=Sample.test.scala
34-
//> using dep org.scalameta::munit:0.7.29
34+
//> using dep org.scalameta::munit:1.0.2
3535
class Test extends munit.FunSuite {
3636
test("sample") {
3737
assert(2 + 2 == 4)
@@ -487,7 +487,7 @@ For example, to exclude all files in the `example/scala` directory, add the foll
487487
`project.file` file:
488488

489489
```scala title=project.scala
490-
//> using exclude "example/scala"
490+
//> using exclude example/scala
491491
```
492492

493493
## Compile-Only Dependencies
@@ -499,7 +499,7 @@ To declare a compile-only dependency, you should use the `compileOnly.dep` direc
499499
option. For instance, to include the `jsoniter-scala-macros` library at compile-time, you would use:
500500

501501
```scala title=CompileOnly.scala
502-
//> using compileOnly.dep "com.github.plokhotnyuk.jsoniter-scala::jsoniter-scala-macros:2.23.2"
502+
//> using compileOnly.dep com.github.plokhotnyuk.jsoniter-scala::jsoniter-scala-macros:2.23.2
503503
```
504504

505505
or by using the `--compile-lib` command line option:

website/docs/commands/export.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ title: Export ⚡️
33
sidebar_position: 27
44
---
55

6-
In case your project outgrows the cabapilities of Scala CLI (e.g support for modules) it may be beneficial
6+
In case your project outgrows the capabilities of Scala CLI (e.g support for modules) it may be beneficial
77
to switch to a build tool such as SBT or Mill.
88
The `export` sub-command allows to do that by converting a Scala CLI project into an SBT or Mill configuration.
99
Additionally the sub-command supports the JSON format for custom analysis of projects.

0 commit comments

Comments
 (0)