From 4537cc89aa1a4e9243510af7ece4ea9f8b09fbcb Mon Sep 17 00:00:00 2001 From: Maciej Gajek Date: Tue, 3 Oct 2023 15:21:47 +0200 Subject: [PATCH 1/2] Add docs for fix command --- website/docs/commands/fix.md | 19 +++++++++++++++++++ website/docs/commands/misc/_category_.json | 2 +- website/docs/commands/package.md | 2 +- .../docs/commands/publishing/_category_.json | 2 +- 4 files changed, 22 insertions(+), 3 deletions(-) create mode 100644 website/docs/commands/fix.md diff --git a/website/docs/commands/fix.md b/website/docs/commands/fix.md new file mode 100644 index 0000000000..24616162a2 --- /dev/null +++ b/website/docs/commands/fix.md @@ -0,0 +1,19 @@ +--- +title: Fix ⚡️ +sidebar_position: 28 +--- + +:::caution +The Fix command is restricted and requires setting the `--power` option to be used. +You can pass it explicitly or set it globally by running: + + scala-cli config power true +::: + +The `fix` command scans your project for `using directives` and extracts them into a `project.scala` file placed in the project's root directory. +This allows to fix the warnings about `using directives` present in multiple files. +Additionally `fix` will format the result file, thus allowing to quickly spot configuration options that may be duplicated. + +Files containing `using target directives`, e.g. `//> using target.scala 3.0.0` will not be changed by `fix`. + +The command respects the original scope of each extracted directive and will transform them into their `test.` equivalent if needed. diff --git a/website/docs/commands/misc/_category_.json b/website/docs/commands/misc/_category_.json index 7630af155e..41abaa715f 100644 --- a/website/docs/commands/misc/_category_.json +++ b/website/docs/commands/misc/_category_.json @@ -1,4 +1,4 @@ { "label": "Miscellaneous ⚡️", - "position": 29 + "position": 31 } diff --git a/website/docs/commands/package.md b/website/docs/commands/package.md index 10624c5a32..9f2ac767f3 100644 --- a/website/docs/commands/package.md +++ b/website/docs/commands/package.md @@ -1,6 +1,6 @@ --- title: Package ⚡️ -sidebar_position: 27 +sidebar_position: 29 --- :::caution diff --git a/website/docs/commands/publishing/_category_.json b/website/docs/commands/publishing/_category_.json index 1242b711d6..af01d125fe 100644 --- a/website/docs/commands/publishing/_category_.json +++ b/website/docs/commands/publishing/_category_.json @@ -1,4 +1,4 @@ { "label": "Publishing ⚡️", - "position": 28 + "position": 30 } From 2c25ce6eb217fe6511ee1ecce4bfb0e5a7d6baca Mon Sep 17 00:00:00 2001 From: Maciej Gajek <61919032+MaciejG604@users.noreply.github.com> Date: Mon, 9 Oct 2023 12:29:20 +0200 Subject: [PATCH 2/2] Apply suggestions from code review Co-authored-by: Piotr Chabelski --- website/docs/commands/fix.md | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/website/docs/commands/fix.md b/website/docs/commands/fix.md index 24616162a2..40f705435f 100644 --- a/website/docs/commands/fix.md +++ b/website/docs/commands/fix.md @@ -4,16 +4,16 @@ sidebar_position: 28 --- :::caution -The Fix command is restricted and requires setting the `--power` option to be used. +The Fix command is experimental and requires setting the `--power` option to be used. You can pass it explicitly or set it globally by running: scala-cli config power true ::: -The `fix` command scans your project for `using directives` and extracts them into a `project.scala` file placed in the project's root directory. -This allows to fix the warnings about `using directives` present in multiple files. -Additionally `fix` will format the result file, thus allowing to quickly spot configuration options that may be duplicated. +The `fix` command scans your project for `using` directives and extracts them into the `project.scala` file placed in the project root directory. +This allows to fix warnings tied to having `using` directives present in multiple files. +Additionally, `fix` will format the result file, thus allowing to quickly spot configuration options that may be duplicated. -Files containing `using target directives`, e.g. `//> using target.scala 3.0.0` will not be changed by `fix`. +Files containing `using target` directives, e.g. `//> using target.scala 3.0.0` will not be changed by `fix`. The command respects the original scope of each extracted directive and will transform them into their `test.` equivalent if needed.