Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add docs for fix command #2437

Merged
merged 2 commits into from Oct 11, 2023
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
19 changes: 19 additions & 0 deletions 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.
MaciejG604 marked this conversation as resolved.
Show resolved Hide resolved
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.
MaciejG604 marked this conversation as resolved.
Show resolved Hide resolved
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.
MaciejG604 marked this conversation as resolved.
Show resolved Hide resolved

Files containing `using target directives`, e.g. `//> using target.scala 3.0.0` will not be changed by `fix`.
MaciejG604 marked this conversation as resolved.
Show resolved Hide resolved

The command respects the original scope of each extracted directive and will transform them into their `test.` equivalent if needed.
2 changes: 1 addition & 1 deletion website/docs/commands/misc/_category_.json
@@ -1,4 +1,4 @@
{
"label": "Miscellaneous ⚡️",
"position": 29
"position": 31
}
2 changes: 1 addition & 1 deletion website/docs/commands/package.md
@@ -1,6 +1,6 @@
---
title: Package ⚡️
sidebar_position: 27
sidebar_position: 29
---

:::caution
Expand Down
2 changes: 1 addition & 1 deletion website/docs/commands/publishing/_category_.json
@@ -1,4 +1,4 @@
{
"label": "Publishing ⚡️",
"position": 28
"position": 30
}