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

Commit

Permalink
chore: upgrade bpaf
Browse files Browse the repository at this point in the history
  • Loading branch information
ematipico committed May 21, 2023
1 parent ab35248 commit eb868ee
Show file tree
Hide file tree
Showing 15 changed files with 54 additions and 13 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
#### Other changes

- `rome lsp-proxy` should accept the global CLI options [#4505](https://github.com/rome/tools/issues/4505)
- Enhance help descriptions

### Configuration

Expand Down
8 changes: 4 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 @@ -34,7 +34,7 @@ tokio = { version = "~1.18.5" }
insta = "1.21.2"
quote = { version = "1.0.21" }
lazy_static = "1.4.0"
bpaf = { version = "0.7.10", features = ["derive"] }
bpaf = { version = "0.8.0", features = ["derive"] }
bitflags = "2.2.1"


1 change: 1 addition & 0 deletions crates/rome_cli/src/cli_options.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
use bpaf::Bpaf;
use std::str::FromStr;

/// Global options applied to all commands
#[derive(Debug, Clone, Bpaf)]
pub struct CliOptions {
/// 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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ expression: content
```block
Run various checks on a set of files.
Usage: [--apply] [--apply-unsafe] <PATH>...
Usage: [--apply] [--apply-unsafe] [<PATH>]...
Available positional items:
<PATH> Single file, single path or list of paths
Expand All @@ -18,6 +18,8 @@ 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.
The configuration that is contained inside the file `rome.json`
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],
Expand All @@ -27,18 +29,25 @@ Available options:
configuration, it will attempt to use the current working directory. If no
current working directory can't be found, Rome won't use the VCS integration,
and a diagnostic will be emitted
The configuration of the filesystem
--files-max-size <NUMBER> The maximum allowed size for source code files in bytes. Files
above this limit will be ignored for performance reason. Defaults to 1 MiB
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.
--quote-style <double|single> The style for quotes. Defaults to double.
--quote-properties <preserve|as-needed> When properties in objects are quoted. Defaults to
asNeeded.
--trailing-comma <all|es5|none> Print trailing commas wherever possible in multi-line
comma-separated syntactic structures. Defaults to "all".
--semicolons <always|as-needed> Whether the formatter prints semicolons for all statements
or only in for statements where it is necessary because of ASI.
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
output is determined to be incompatible
Expand All @@ -50,6 +59,7 @@ Available options:
--skip-errors Skip over files containing syntax errors instead of emitting an error
diagnostic.
--json Reports information using the JSON format
--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
Expand Down
12 changes: 11 additions & 1 deletion crates/rome_cli/tests/snapshots/main_commands_ci/ci_help.snap
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ expression: content
Command to use in CI environments. Run various checks of a set of files.
Usage: [--formatter-enabled true|false] [--linter-enabled true|false] [--organize-imports-enabled
true|false] <PATH>...
true|false] [<PATH>]...
Available positional items:
<PATH> Single file, single path or list of paths
Expand All @@ -17,6 +17,8 @@ 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.
The configuration that is contained inside the file `rome.json`
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],
Expand All @@ -26,18 +28,25 @@ Available options:
configuration, it will attempt to use the current working directory. If no
current working directory can't be found, Rome won't use the VCS integration,
and a diagnostic will be emitted
The configuration of the filesystem
--files-max-size <NUMBER> The maximum allowed size for source code files in bytes. Files
above this limit will be ignored for performance reason. Defaults to 1 MiB
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.
--quote-style <double|single> The style for quotes. Defaults to double.
--quote-properties <preserve|as-needed> When properties in objects are quoted. Defaults to
asNeeded.
--trailing-comma <all|es5|none> Print trailing commas wherever possible in multi-line
comma-separated syntactic structures. Defaults to "all".
--semicolons <always|as-needed> Whether the formatter prints semicolons for all statements
or only in for statements where it is necessary because of ASI.
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
output is determined to be incompatible
Expand All @@ -49,6 +58,7 @@ Available options:
--skip-errors Skip over files containing syntax errors instead of emitting an error
diagnostic.
--json Reports information using the JSON format
-h, --help Prints help information
```
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,22 +7,25 @@ expression: content
```block
Run the formatter on a set of files.
Usage: [--write] <PATH>...
Usage: [--write] [<PATH>]...
Available positional items:
<PATH> Single file, single path or list of paths
Available options:
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.
--quote-style <double|single> The style for quotes. Defaults to double.
--quote-properties <preserve|as-needed> When properties in objects are quoted. Defaults to
asNeeded.
--trailing-comma <all|es5|none> Print trailing commas wherever possible in multi-line
comma-separated syntactic structures. Defaults to "all".
--semicolons <always|as-needed> Whether the formatter prints semicolons for all statements
or only in for statements where it is necessary because of ASI.
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],
Expand All @@ -32,10 +35,14 @@ Available options:
configuration, it will attempt to use the current working directory. If no
current working directory can't be found, Rome won't use the VCS integration,
and a diagnostic will be emitted
The configuration of the filesystem
--files-max-size <NUMBER> The maximum allowed size for source code files in bytes. Files
above this limit will be ignored for performance reason. Defaults to 1 MiB
--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"
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
output is determined to be incompatible
Expand All @@ -47,6 +54,7 @@ Available options:
--skip-errors Skip over files containing syntax errors instead of emitting an error
diagnostic.
--json Reports information using the JSON format
--write
-h, --help Prints help information
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ expression: content
```block
Bootstraps a new rome project. Creates a configuration file with some defaults.
Usage: no parameters expected
Available options:
-h, --help Prints help information
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,11 @@ expression: content
```block
Acts as a server for the Language Server Protocol over stdin/stdout
Usage: [--colors off|force] [[--use-server]] [[--verbose]] [--config-path PATH] [--max-diagnostics
Usage: [--colors off|force] [--use-server] [--verbose] [--config-path PATH] [--max-diagnostics
NUMBER] [--skip-errors]
Available options:
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
output is determined to be incompatible
Expand All @@ -22,6 +23,7 @@ Available options:
--skip-errors Skip over files containing syntax errors instead of emitting an error
diagnostic.
--json Reports information using the JSON format
-h, --help Prints help information
```
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ It updates the configuration when there are breaking changes
Usage: [--write]
Available options:
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
output is determined to be incompatible
Expand All @@ -21,6 +22,7 @@ Available options:
--skip-errors Skip over files containing syntax errors instead of emitting an error
diagnostic.
--json Reports information using the JSON format
--write Writes the new configuration file to disk
-h, --help Prints help information
Expand Down
1 change: 1 addition & 0 deletions crates/rome_service/src/configuration/formatter.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ use rome_formatter::{IndentStyle, LineWidth};
use serde::{Deserialize, Serialize};
use std::str::FromStr;

/// Options applied to the formatter
#[derive(Deserialize, Serialize, Debug, Eq, PartialEq, Clone, Bpaf)]
#[cfg_attr(feature = "schemars", derive(schemars::JsonSchema))]
#[serde(rename_all = "camelCase", default, deny_unknown_fields)]
Expand Down
2 changes: 1 addition & 1 deletion crates/rome_service/src/configuration/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ pub struct Configuration {
#[bpaf(hide)]
pub schema: Option<String>,

/// The configuration of the filesystem
/// The configuration of the VCS integration
#[serde(skip_serializing_if = "Option::is_none")]
#[bpaf(external(vcs_configuration), optional, hide_usage)]
pub vcs: Option<VcsConfiguration>,
Expand Down
3 changes: 2 additions & 1 deletion editors/vscode/configuration_schema.json

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

5 changes: 4 additions & 1 deletion npm/backend-jsonrpc/src/workspace.ts

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

3 changes: 2 additions & 1 deletion npm/rome/configuration_schema.json

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

0 comments on commit eb868ee

Please sign in to comment.