Skip to content
This repository was archived by the owner on Aug 31, 2023. It is now read-only.
Prev Previous commit
Next Next commit
rename option config -> config-path
  • Loading branch information
realtimetodie committed Feb 12, 2023
commit 7548b5791171d0cae29dbd7129051ee9fc8cf2ed
6 changes: 3 additions & 3 deletions crates/rome_cli/src/commands/help.rs
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ const CHECK: Markup = markup! {
"<Dim>"--apply"</Dim>" Apply safe fixes
"<Dim>"--apply-unsafe"</Dim>" Apply safe and unsafe fixes
"<Dim>"--max-diagnostics"</Dim>" Cap the amount of diagnostics displayed (default: 20)
"<Dim>"--config"</Dim>" Set the filesystem path to the directory of the rome.json configuration file
"<Dim>"--config-path"</Dim>" Set the filesystem path to the directory of the rome.json configuration file
"<Dim>"--verbose"</Dim>" Print additional verbose advices on diagnostics
"
};
Expand Down Expand Up @@ -66,7 +66,7 @@ const CI: Markup = markup! {
"<Dim>"--formatter-enabled"</Dim>" Allow to enable or disable the formatter check. (default: true)
"<Dim>"--linter-enabled"</Dim>" Allow to enable or disable the linter check. (default: true)
"<Dim>"--max-diagnostics"</Dim>" Cap the amount of diagnostics displayed (default: 50)
"<Dim>"--config"</Dim>" Set the filesystem path to the directory of the rome.json configuration file
"<Dim>"--config-path"</Dim>" Set the filesystem path to the directory of the rome.json configuration file
"<Dim>"--verbose"</Dim>" Print additional verbose advices on diagnostics"
{FORMAT_OPTIONS}
};
Expand All @@ -83,7 +83,7 @@ const FORMAT: Markup = markup! {
"<Dim>"--write"</Dim>" Edit the files in place (beware!) instead of printing the diff to the console
"<Dim>"--skip-errors"</Dim>" Skip over files containing syntax errors instead of emitting an error diagnostic.
"<Dim>"--max-diagnostics"</Dim>" Cap the amount of diagnostics displayed (default: 50)
"<Dim>"--config"</Dim>" Set the filesystem path to the directory of the rome.json configuration file
"<Dim>"--config-path"</Dim>" Set the filesystem path to the directory of the rome.json configuration file
"<Dim>"--verbose"</Dim>" Print additional verbose advices on diagnostics"
{FORMAT_OPTIONS}
""<Dim>"--stdin-file-path <string>"</Dim>" 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
Expand Down
4 changes: 2 additions & 2 deletions crates/rome_cli/src/configuration.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@ use crate::{CliDiagnostic, CliSession};
pub(crate) fn load_configuration(session: &mut CliSession) -> Result<Configuration, CliDiagnostic> {
let config_path: Option<PathBuf> = session
.args
.opt_value_from_str("--config")
.map_err(|source| CliDiagnostic::parse_error("--config", source))?;
.opt_value_from_str("--config-path")
.map_err(|source| CliDiagnostic::parse_error("--config-path", source))?;

let is_config_path = config_path.is_some();

Expand Down
4 changes: 2 additions & 2 deletions crates/rome_cli/tests/commands/format.rs
Original file line number Diff line number Diff line change
Expand Up @@ -264,7 +264,7 @@ fn custom_config_file_path() {
&mut console,
Arguments::from_vec(vec![
OsString::from("format"),
OsString::from("--config"),
OsString::from("--config-path"),
OsString::from(config_path),
OsString::from("--write"),
file_path.as_os_str().into(),
Expand Down Expand Up @@ -308,7 +308,7 @@ fn invalid_config_file_path() {
&mut console,
Arguments::from_vec(vec![
OsString::from("format"),
OsString::from("--config"),
OsString::from("--config-path"),
OsString::from(config_path),
OsString::from("--write"),
file_path.as_os_str().into(),
Expand Down
2 changes: 1 addition & 1 deletion website/src/pages/cli.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ 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

### `--config`
### `--config-path`

Set the filesystem path to the directory of the rome.json configuration file.
This is optional. Rome will try to read a rome.json configuration file from the
Expand Down