Skip to content

Commit

Permalink
Merge pull request #2031 from bjaglin/slash-syntax
Browse files Browse the repository at this point in the history
docs: use slash syntax for sbt
  • Loading branch information
bjaglin authored Aug 13, 2024
2 parents df2d964 + 3f7b314 commit d33af59
Show file tree
Hide file tree
Showing 7 changed files with 27 additions and 27 deletions.
12 changes: 6 additions & 6 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,23 +29,23 @@ sbt shell.

```sh
# Fast unit tests for rules, cli, core.
> unit2_13/test
> unit2_13 / test

# Integration tests for rules, cli, core. Contains a lot
# of different test suites, so it's recommended to use testOnly
# and/or testQuick.
> integration2_13/test
> integration2_13 / test

# Use testWindows to exclude tests that are not expected to succeed
# on that OS.
> unit2_13/testWindows
> integration2_13/testWindows
> unit2_13 / testWindows
> integration2_13 / testWindows

# Only run tests for built-in rules, using scalafix-testkit.
> expect2_13Target2_13_10/test
> expect2_13Target2_13_10 / test

# Only run ProcedureSyntax unit tests.
> expect2_13Target2_13_10/testOnly -- -z ProcedureSyntax
> expect2_13Target2_13_10 / testOnly -- -z ProcedureSyntax
```

[sbt-projectmatrix](https://github.com/sbt/sbt-projectmatrix) is used to
Expand Down
6 changes: 3 additions & 3 deletions docs/developers/local-rules.md
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ promoting them to the [build-level](#as-a-separate-sub-project).

```bash
$ sbt
> service1/scalafix MyRule1 MyRule2
> service1 / scalafix MyRule1 MyRule2
```

### As a separate sub-project
Expand Down Expand Up @@ -193,6 +193,6 @@ semantic rules.

```bash
$ sbt
> scalafixTests/test
> service1/scalafix MyRule1 MyRule2
> scalafixTests / test
> service1 / scalafix MyRule1 MyRule2
```
8 changes: 4 additions & 4 deletions docs/developers/setup.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ cd repo-name # The project you want to implement rules for.
sbt new scalacenter/scalafix.g8 --repo="Repository Name"
cd scalafix
sbt tests/test
sbt tests / test
```

The `--repo=<repository name>` option should match the name of your GitHub
Expand Down Expand Up @@ -79,11 +79,11 @@ several sub-projects for each directory.
The `scalafix/` directory is a self-contained sbt build and can live in the same
directory as your existing library.

To run unit tests, execute `tests/test`.
To run unit tests, execute `tests / test`.

```
$ sbt
> ~tests/test
> ~tests / test
```

### Import into IntelliJ
Expand Down Expand Up @@ -118,7 +118,7 @@ The output project can use any Scala compiler version.
### Running a single test

To run a single test case instead of the full test suite run the following
command: `tests/testOnly *MySuite -- -z MyRegex`. This will run only test cases
command: `tests / testOnly *MySuite -- -z MyRegex`. This will run only test cases
with the names matching the regular expression "MyRegex" inside test suites
matching the regular expression `*MySuite`. See the ScalaTest documentation
section:
Expand Down
8 changes: 4 additions & 4 deletions docs/developers/tutorial.md
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ sbt:scalafix>
```

This starts an sbt shell session from where you can run the test suite with
`tests/test`.
`tests / test`.

Optionally, if you use IntelliJ, import the build like normal with the action
"New project from existing sources" and select the `scalafix/build.sbt` file.
Expand Down Expand Up @@ -87,10 +87,10 @@ output/src

Checkout the first commit
[c03e549](https://github.com/scalacenter/scalafix-named-literal-arguments/commit/c03e5493b1e7ee9d82abebf2aa84b3bfcf01455b),
run `tests/test` and see the tests fail
run `tests / test` and see the tests fail

```diff
> ~tests/test
> ~tests / test
--- obtained
+++ expected
@@ -4,3 +4,3 @@
Expand Down Expand Up @@ -457,7 +457,7 @@ class NoLiteralArgumentsConfig {
The top of the file contains `.scalafix.conf` configuration that is passed to
rules when they're loaded.

If we run `tests/test` we get an error like this
If we run `tests / test` we get an error like this

```scala
===========> Unreported <===========
Expand Down
12 changes: 6 additions & 6 deletions docs/users/installation.md
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ addSbtPlugin("ch.epfl.scala" % "sbt-scalafix" % "@VERSION@")
From the sbt shell, let's run the rule `ProcedureSyntax`
```
> myproject/scalafix ProcedureSyntax
> myproject / scalafix ProcedureSyntax
```
It's normal that the first invocation of `scalafix` takes a while to download
Expand All @@ -60,7 +60,7 @@ should have a diff in your sources like this
Next, if we run another rule like `RemoveUnused` then we get an error

```
> myproject/scalafix RemoveUnused
> myproject / scalafix RemoveUnused
[error] (Compile / scalafix) scalafix.sbt.InvalidArgument: 2 errors
[E1] The scalac compiler should produce semanticdb files to run semantic
rules like RemoveUnused ...
Expand Down Expand Up @@ -125,7 +125,7 @@ resolve `scalafixSemanticdb`.
We run `RemoveUnused` again and the error is now gone

```
> myproject/scalafix RemoveUnused
> myproject / scalafix RemoveUnused
[info] Compiling 15 Scala sources to ...
[info] Running scalafix on 15 Scala sources
```
Expand Down Expand Up @@ -172,10 +172,10 @@ Great! You are all set to use Scalafix with sbt :)
### Main and test sources
The task `myproject/scalafix` runs for **main sources** in the project
The task `myproject / scalafix` runs for **main sources** in the project
`myproject`. To run Scalafix on **test sources**, execute
`myproject/test:scalafix` instead. To run on both main and test sources, execute
`myproject/scalafixAll`.
`myproject / Test / scalafix` instead. To run on both main and test sources, execute
`myproject / scalafixAll`.
### Integration tests
Expand Down
4 changes: 2 additions & 2 deletions project/ScalafixBuild.scala
Original file line number Diff line number Diff line change
Expand Up @@ -192,8 +192,8 @@ object ScalafixBuild extends AutoPlugin with GhpagesKeys {
updateOptions := updateOptions.value.withCachedResolution(true),
ThisBuild / watchTriggeredMessage := Watch.clearScreenOnTrigger,
commands += Command.command("save-expect") { s =>
"integration2_13/test:runMain scalafix.tests.util.SaveExpect" ::
"integration3/test:runMain scalafix.tests.util.SaveExpect" ::
"integration2_13 / Test / runMain scalafix.tests.util.SaveExpect" ::
"integration3 / Test / runMain scalafix.tests.util.SaveExpect" ::
s
},
commands += Command.command("ci-docs") { s =>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@ import scalafix.internal.tests.utils.SkipWindows
/**
* Tests in this suite require scalafix-cli & its dependencies to be
* cross-published so that Coursier can fetch them. That is done automatically
* as part of `sbt integrationX/test`, so make sure to run that once if you want
* to run the test with testOnly or through BSP.
* as part of `sbt integrationX / test`, so make sure to run that once if you
* want to run the test with testOnly or through BSP.
*/
class ScalafixSuite extends AnyFunSuite {

Expand Down

0 comments on commit d33af59

Please sign in to comment.