Skip to content
This repository has been archived by the owner on Aug 31, 2023. It is now read-only.

docs: auto generated CLI reference #4671

Merged
merged 1 commit into from
Jul 18, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 5 additions & 4 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ tests_macros = { path = "./crates/tests_macros" }
quickcheck_macros = "1.0.0"
quickcheck = "1.0.3"
bitflags = "2.3.1"
bpaf = { version = "0.9.1", features = ["derive"] }
bpaf = { version = "0.9.2", features = ["derive"] }
countme = "3.0.1"
dashmap = "5.4.0"
indexmap = "1.9.3"
Expand Down
3 changes: 3 additions & 0 deletions crates/rome_cli/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -59,3 +59,6 @@ rome_js_formatter = { workspace = true }
rome_json_formatter = { workspace = true }
rome_json_parser = { workspace = true }
tokio = { workspace = true, features = ["io-util"] }

[features]
docgen = ["bpaf/docgen"]
2 changes: 0 additions & 2 deletions crates/rome_cli/src/commands/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,6 @@ pub(crate) mod version;

#[derive(Debug, Clone, Bpaf)]
#[bpaf(options, version(VERSION))]
/// Rome CLI
///
/// Rome official CLI. Use it to check the health of your project or run it to check single files.
pub enum RomeCommand {
/// Shows the Rome version information and quit
Expand Down
33 changes: 16 additions & 17 deletions crates/rome_cli/tests/snapshots/main_commands_check/check_help.snap
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ The configuration that is contained inside the file `rome.json`
--vcs-enabled=<true|false> Whether Rome should integrate itself with the VCS client
--vcs-use-ignore-file=<true|false> Whether Rome should use the VCS ignore file. When [true],
Rome will ignore the files specified in the ignore file.
--vcs-root=PATH The folder where Rome should check for VCS files. By default, Rome will
--vcs-root=PATH The folder where Rome should check for VCS files. By default, Rome will
use the same folder where `rome.json` was found.
If Rome can't find the configuration, it will attempt to use the current
working directory. If no current working directory can't be found, Rome
Expand All @@ -24,8 +24,8 @@ The configuration that is contained inside the file `rome.json`
--files-ignore-unknown=<true|false> Tells Rome to not emit diagnostics when handling files that
doesn't know
--indent-style=<tab|space> The indent style.
--indent-size=NUMBER The size of the indentation, 2 by default
--line-width=NUMBER What's the max width of a line. Defaults to 80.
--indent-size=NUMBER The size of the indentation, 2 by default
--line-width=NUMBER What's the max width of a line. Defaults to 80.
--quote-style=<double|single> The style for quotes. Defaults to double.
--jsx-quote-style=<double|single> The style for JSX quotes. Defaults to double.
--quote-properties=<preserve|as-needed> When properties in objects are quoted. Defaults to asNeeded.
Expand All @@ -37,34 +37,33 @@ The configuration that is contained inside the file `rome.json`
Defaults to "always".

Global options applied to all commands
--colors=<off|force> Set the formatting mode for markup: "off" prints everything as plain
text, "force" forces the formatting of markup using ANSI even if the console
--colors=<off|force> Set the formatting mode for markup: "off" prints everything as plain text,
"force" forces the formatting of markup using ANSI even if the console
output is determined to be incompatible
--use-server Connect to a running instance of the Rome daemon server.
--verbose Print additional verbose advices on diagnostics
--config-path=PATH Set the filesystem path to the directory of the rome.json configuration
--use-server Connect to a running instance of the Rome daemon server.
--verbose Print additional verbose advices on diagnostics
--config-path=PATH Set the filesystem path to the directory of the rome.json configuration
file
--max-diagnostics=NUMBER Cap the amount of diagnostics displayed.
[default: 20]
--skip-errors Skip over files containing syntax errors instead of emitting an error
diagnostic.
[default: 20]
--skip-errors Skip over files containing syntax errors instead of emitting an error diagnostic.
--no-errors-on-unmatched Silence errors that would be emitted in case no files were processed
during the execution of the command.
--error-on-warnings Tell Rome to exit with an error code if some diagnostics emit warnings.
--json Reports information using the JSON format
--error-on-warnings Tell Rome to exit with an error code if some diagnostics emit warnings.
--json Reports information using the JSON format

Available positional items:
PATH Single file, single path or list of paths
PATH Single file, single path or list of paths

Available options:
--apply Apply safe fixes, formatting
--apply-unsafe Apply safe fixes and unsafe fixes, formatting and import sorting
--apply Apply safe fixes, formatting
--apply-unsafe Apply safe fixes and unsafe fixes, formatting and import sorting
--formatter-enabled=<true|false> Allow to enable or disable the formatter check.
--linter-enabled=<true|false> Allow to enable or disable the linter check.
--organize-imports-enabled=<true|false> Allow to enable or disable the organize imports.
--stdin-file-path=PATH A file name with its extension to pass when reading from standard in,
e.g. echo 'let a;' | rome check --stdin-file-path=file.js"
-h, --help Prints help information
-h, --help Prints help information

```

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ flags/invalid ━━━━━━━━━━━━━━━━━━━━━━
× Failed to parse CLI arguments.

Caused by:
Couldn't parse `-1`: invalid digit found in string
couldn't parse `-1`: invalid digit found in string



Expand Down
29 changes: 14 additions & 15 deletions crates/rome_cli/tests/snapshots/main_commands_ci/ci_help.snap
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ The configuration that is contained inside the file `rome.json`
--vcs-enabled=<true|false> Whether Rome should integrate itself with the VCS client
--vcs-use-ignore-file=<true|false> Whether Rome should use the VCS ignore file. When [true],
Rome will ignore the files specified in the ignore file.
--vcs-root=PATH The folder where Rome should check for VCS files. By default, Rome will
--vcs-root=PATH The folder where Rome should check for VCS files. By default, Rome will
use the same folder where `rome.json` was found.
If Rome can't find the configuration, it will attempt to use the current
working directory. If no current working directory can't be found, Rome
Expand All @@ -25,8 +25,8 @@ The configuration that is contained inside the file `rome.json`
--files-ignore-unknown=<true|false> Tells Rome to not emit diagnostics when handling files that
doesn't know
--indent-style=<tab|space> The indent style.
--indent-size=NUMBER The size of the indentation, 2 by default
--line-width=NUMBER What's the max width of a line. Defaults to 80.
--indent-size=NUMBER The size of the indentation, 2 by default
--line-width=NUMBER What's the max width of a line. Defaults to 80.
--quote-style=<double|single> The style for quotes. Defaults to double.
--jsx-quote-style=<double|single> The style for JSX quotes. Defaults to double.
--quote-properties=<preserve|as-needed> When properties in objects are quoted. Defaults to asNeeded.
Expand All @@ -38,30 +38,29 @@ The configuration that is contained inside the file `rome.json`
Defaults to "always".

Global options applied to all commands
--colors=<off|force> Set the formatting mode for markup: "off" prints everything as plain
text, "force" forces the formatting of markup using ANSI even if the console
--colors=<off|force> Set the formatting mode for markup: "off" prints everything as plain text,
"force" forces the formatting of markup using ANSI even if the console
output is determined to be incompatible
--use-server Connect to a running instance of the Rome daemon server.
--verbose Print additional verbose advices on diagnostics
--config-path=PATH Set the filesystem path to the directory of the rome.json configuration
--use-server Connect to a running instance of the Rome daemon server.
--verbose Print additional verbose advices on diagnostics
--config-path=PATH Set the filesystem path to the directory of the rome.json configuration
file
--max-diagnostics=NUMBER Cap the amount of diagnostics displayed.
[default: 20]
--skip-errors Skip over files containing syntax errors instead of emitting an error
diagnostic.
[default: 20]
--skip-errors Skip over files containing syntax errors instead of emitting an error diagnostic.
--no-errors-on-unmatched Silence errors that would be emitted in case no files were processed
during the execution of the command.
--error-on-warnings Tell Rome to exit with an error code if some diagnostics emit warnings.
--json Reports information using the JSON format
--error-on-warnings Tell Rome to exit with an error code if some diagnostics emit warnings.
--json Reports information using the JSON format

Available positional items:
PATH Single file, single path or list of paths
PATH Single file, single path or list of paths

Available options:
--formatter-enabled=<true|false> Allow to enable or disable the formatter check.
--linter-enabled=<true|false> Allow to enable or disable the linter check.
--organize-imports-enabled=<true|false> Allow to enable or disable the organize imports.
-h, --help Prints help information
-h, --help Prints help information

```

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ flags/invalid ━━━━━━━━━━━━━━━━━━━━━━
× Failed to parse CLI arguments.

Caused by:
Couldn't parse `-1`: invalid digit found in string
couldn't parse `-1`: invalid digit found in string



Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ flags/invalid ━━━━━━━━━━━━━━━━━━━━━━
× Failed to parse CLI arguments.

Caused by:
Couldn't parse `-1`: invalid digit found in string
couldn't parse `-1`: invalid digit found in string



Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,15 +11,15 @@ Usage: format [--write] [PATH]...

Options applied to the formatter
--indent-style=<tab|space> The indent style.
--indent-size=NUMBER The size of the indentation, 2 by default
--line-width=NUMBER What's the max width of a line. Defaults to 80.
--indent-size=NUMBER The size of the indentation, 2 by default
--line-width=NUMBER What's the max width of a line. Defaults to 80.

Set of properties to integrate Rome with a VCS software.
--vcs-client-kind=<git> The kind of client.
--vcs-enabled=<true|false> Whether Rome should integrate itself with the VCS client
--vcs-use-ignore-file=<true|false> Whether Rome should use the VCS ignore file. When [true],
Rome will ignore the files specified in the ignore file.
--vcs-root=PATH The folder where Rome should check for VCS files. By default, Rome will
--vcs-root=PATH The folder where Rome should check for VCS files. By default, Rome will
use the same folder where `rome.json` was found.
If Rome can't find the configuration, it will attempt to use the current
working directory. If no current working directory can't be found, Rome
Expand All @@ -32,24 +32,23 @@ The configuration of the filesystem
doesn't know

Global options applied to all commands
--colors=<off|force> Set the formatting mode for markup: "off" prints everything as plain
text, "force" forces the formatting of markup using ANSI even if the console
--colors=<off|force> Set the formatting mode for markup: "off" prints everything as plain text,
"force" forces the formatting of markup using ANSI even if the console
output is determined to be incompatible
--use-server Connect to a running instance of the Rome daemon server.
--verbose Print additional verbose advices on diagnostics
--config-path=PATH Set the filesystem path to the directory of the rome.json configuration
--use-server Connect to a running instance of the Rome daemon server.
--verbose Print additional verbose advices on diagnostics
--config-path=PATH Set the filesystem path to the directory of the rome.json configuration
file
--max-diagnostics=NUMBER Cap the amount of diagnostics displayed.
[default: 20]
--skip-errors Skip over files containing syntax errors instead of emitting an error
diagnostic.
[default: 20]
--skip-errors Skip over files containing syntax errors instead of emitting an error diagnostic.
--no-errors-on-unmatched Silence errors that would be emitted in case no files were processed
during the execution of the command.
--error-on-warnings Tell Rome to exit with an error code if some diagnostics emit warnings.
--json Reports information using the JSON format
--error-on-warnings Tell Rome to exit with an error code if some diagnostics emit warnings.
--json Reports information using the JSON format

Available positional items:
PATH Single file, single path or list of paths.
PATH Single file, single path or list of paths.

Available options:
--quote-style=<double|single> The style for quotes. Defaults to double.
Expand All @@ -63,8 +62,8 @@ Available options:
Defaults to "always".
--stdin-file-path=PATH A file name with its extension to pass when reading from standard in,
e.g. echo 'let a;' | rome format --stdin-file-path=file.js".
--write Writes formatted files to file system.
-h, --help Prints help information
--write Writes formatted files to file system.
-h, --help Prints help information

```

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ flags/invalid ━━━━━━━━━━━━━━━━━━━━━━
× Failed to parse CLI arguments.

Caused by:
Couldn't parse `-1`: invalid digit found in string
couldn't parse `-1`: invalid digit found in string



Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ flags/invalid ━━━━━━━━━━━━━━━━━━━━━━
× Failed to parse CLI arguments.

Caused by:
Couldn't parse `257`: number too large to fit in target type
couldn't parse `257`: number too large to fit in target type



Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ flags/invalid ━━━━━━━━━━━━━━━━━━━━━━
× Failed to parse CLI arguments.

Caused by:
Couldn't parse `invalid`: Unsupported value for this option
couldn't parse `invalid`: Unsupported value for this option



Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ flags/invalid ━━━━━━━━━━━━━━━━━━━━━━
× Failed to parse CLI arguments.

Caused by:
Couldn't parse `-1`: invalid digit found in string
couldn't parse `-1`: invalid digit found in string



Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ flags/invalid ━━━━━━━━━━━━━━━━━━━━━━
× Failed to parse CLI arguments.

Caused by:
Couldn't parse `321`: The line width exceeds the maximum value (320)
couldn't parse `321`: The line width exceeds the maximum value (320)



Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ flags/invalid ━━━━━━━━━━━━━━━━━━━━━━
× Failed to parse CLI arguments.

Caused by:
Couldn't parse `As-needed`: Value not supported for QuoteProperties
couldn't parse `As-needed`: Value not supported for QuoteProperties



Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ flags/invalid ━━━━━━━━━━━━━━━━━━━━━━
× Failed to parse CLI arguments.

Caused by:
Couldn't parse `NONE`: Value not supported for TrailingComma
couldn't parse `NONE`: Value not supported for TrailingComma



Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ flags/invalid ━━━━━━━━━━━━━━━━━━━━━━
× Failed to parse CLI arguments.

Caused by:
Couldn't parse `asneed`: Value not supported for Semicolons. Supported values are 'as-needed' and 'always'.
couldn't parse `asneed`: Value not supported for Semicolons. Supported values are 'as-needed' and 'always'.



Expand Down
Loading
Loading