Skip to content

Commit

Permalink
scalafix: gen doc
Browse files Browse the repository at this point in the history
  • Loading branch information
dos65 committed Oct 22, 2024
1 parent d1a7ae9 commit 6bb8c5b
Show file tree
Hide file tree
Showing 7 changed files with 50 additions and 656 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -57,9 +57,6 @@ object ScalafixOptions {
|
|`scalafix` is used to check project code or rewrite it under the hood with use of specified rules.
|
|The `.scalafix.conf` configuration file is optional.
|Default configuration values will be assumed by $fullRunnerName.
|
|All standard $fullRunnerName inputs are accepted, but only Scala sources will be refactored (.scala and .sc files).
|
|${HelpMessages.commandDocWebsiteReference(cmdName)}""".stripMargin
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,7 @@ abstract class ScalafixTestDefinitions extends ScalaCliSuite with TestScalaVersi
scalaVersionArgs
).call(cwd = root)
val updatedContent = noCrLf(os.read(root / "Hello.scala"))
val expected =
val expected = noCrLf {
s"""|//> using options $unusedRuleOption
|package hello
|
Expand All @@ -144,6 +144,7 @@ abstract class ScalafixTestDefinitions extends ScalaCliSuite with TestScalaVersi
| }
|}
|""".stripMargin
}

expect(updatedContent == expected)

Expand Down
36 changes: 18 additions & 18 deletions website/docs/reference/cli-options.md
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ are assumed to be Scala compiler options and will be propagated to Scala Compile

Available in commands:

[`bsp`](./commands.md#bsp), [`compile`](./commands.md#compile), [`dependency-update`](./commands.md#dependency-update), [`doc`](./commands.md#doc), [`export`](./commands.md#export), [`fix`](./commands.md#fix), [`fmt` , `format` , `scalafmt`](./commands.md#fmt), [`package`](./commands.md#package), [`publish`](./commands.md#publish), [`publish local`](./commands.md#publish-local), [`repl` , `console`](./commands.md#repl), [`run`](./commands.md#run), [`setup-ide`](./commands.md#setup-ide), [`shebang`](./commands.md#shebang), [`test`](./commands.md#test)
[`bsp`](./commands.md#bsp), [`compile`](./commands.md#compile), [`dependency-update`](./commands.md#dependency-update), [`doc`](./commands.md#doc), [`export`](./commands.md#export), [`fix`](./commands.md#fix), [`fmt` , `format` , `scalafmt`](./commands.md#fmt), [`package`](./commands.md#package), [`publish`](./commands.md#publish), [`publish local`](./commands.md#publish-local), [`repl` , `console`](./commands.md#repl), [`run`](./commands.md#run), [`scalafix`](./commands.md#scalafix), [`setup-ide`](./commands.md#setup-ide), [`shebang`](./commands.md#shebang), [`test`](./commands.md#test)

<!-- Automatically generated, DO NOT EDIT MANUALLY -->

Expand Down Expand Up @@ -1474,20 +1474,6 @@ Aliases: `--verbose-scalac`

Turn verbosity on for scalac. This is an alias for --scalac-option -verbose

## Scope options

Available in commands:

[`compile`](./commands.md#compile), [`repl` , `console`](./commands.md#repl)

<!-- Automatically generated, DO NOT EDIT MANUALLY -->

### `--test`

Aliases: `--test-scope`, `--with-test`, `--with-test-scope`

Include test scope

## Scalafix options

Available in commands:
Expand All @@ -1502,15 +1488,29 @@ Custom path to the scalafix configuration file.

### `--scalafix-arg`

Pass an argument to scalafix.
Pass extra argument(s) to scalafix.

### `--rules`

Pass rules directly to scalafix.
Run rule(s) explicitly, overriding the configuration file default.

### `--check`

Check if sources are well organized
Fail the invocation if rewrites are needed

## Scope options

Available in commands:

[`compile`](./commands.md#compile), [`repl` , `console`](./commands.md#repl)

<!-- Automatically generated, DO NOT EDIT MANUALLY -->

### `--test`

Aliases: `--test-scope`, `--with-test`, `--with-test-scope`

Include test scope

## Secret options

Expand Down
11 changes: 8 additions & 3 deletions website/docs/reference/commands.md
Original file line number Diff line number Diff line change
Expand Up @@ -158,15 +158,19 @@ Accepts option groups: [benchmarking](./cli-options.md#benchmarking-options), [c

## scalafix

Fixes Scala code according to scalafix rules.
Run Scalafix rules to lint or rewrite Scala code.

`scalafix` is used to lint or rewrite project's code according to specified rules.
`scalafix` is used to check project code or rewrite it under the hood with use of specified rules.

All standard Scala CLI inputs are accepted, but only Scala sources will be refactored (.scala and .sc files).

For detailed documentation refer to our website: https://scala-cli.virtuslab.org/docs/commands/scalafix

Accepts option groups: [compilation server](./cli-options.md#compilation-server-options), [coursier](./cli-options.md#coursier-options), [debug](./cli-options.md#debug-options), [dependency](./cli-options.md#dependency-options), [global suppress warning](./cli-options.md#global-suppress-warning-options), [help group](./cli-options.md#help-group-options), [input](./cli-options.md#input-options), [jvm](./cli-options.md#jvm-options), [logging](./cli-options.md#logging-options), [markdown](./cli-options.md#markdown-options), [power](./cli-options.md#power-options), [python](./cli-options.md#python-options), [Scala.js](./cli-options.md#scalajs-options), [Scala Native](./cli-options.md#scala-native-options), [scalac](./cli-options.md#scalac-options), [scalac extra](./cli-options.md#scalac-extra-options), [Scalafix](./cli-options.md#scalafix-options), [semantic db](./cli-options.md#semantic-db-options), [shared](./cli-options.md#shared-options), [snippet](./cli-options.md#snippet-options), [source generator](./cli-options.md#source-generator-options), [suppress warning](./cli-options.md#suppress-warning-options), [verbosity](./cli-options.md#verbosity-options), [version](./cli-options.md#version-options), [workspace](./cli-options.md#workspace-options)
The `scalafix` sub-command is experimental.
Please bear in mind that non-ideal user experience should be expected.
If you encounter any bugs or have feedback to share, make sure to reach out to the maintenance team at https://github.com/VirtusLab/scala-cli

Accepts option groups: [benchmarking](./cli-options.md#benchmarking-options), [compilation server](./cli-options.md#compilation-server-options), [coursier](./cli-options.md#coursier-options), [debug](./cli-options.md#debug-options), [dependency](./cli-options.md#dependency-options), [global suppress warning](./cli-options.md#global-suppress-warning-options), [help group](./cli-options.md#help-group-options), [input](./cli-options.md#input-options), [jvm](./cli-options.md#jvm-options), [logging](./cli-options.md#logging-options), [markdown](./cli-options.md#markdown-options), [power](./cli-options.md#power-options), [python](./cli-options.md#python-options), [Scala.js](./cli-options.md#scalajs-options), [Scala Native](./cli-options.md#scala-native-options), [scalac](./cli-options.md#scalac-options), [scalac extra](./cli-options.md#scalac-extra-options), [Scalafix](./cli-options.md#scalafix-options), [semantic db](./cli-options.md#semantic-db-options), [shared](./cli-options.md#shared-options), [snippet](./cli-options.md#snippet-options), [source generator](./cli-options.md#source-generator-options), [suppress warning](./cli-options.md#suppress-warning-options), [verbosity](./cli-options.md#verbosity-options), [version](./cli-options.md#version-options), [workspace](./cli-options.md#workspace-options)

## help

Expand Down Expand Up @@ -569,3 +573,4 @@ Accepts option groups: [pgp sign](./cli-options.md#pgp-sign-options)
Verify PGP signatures

Accepts option groups: [pgp verify](./cli-options.md#pgp-verify-options)

Loading

0 comments on commit 6bb8c5b

Please sign in to comment.