Skip to content

Commit 955a4b4

Browse files
committed
docs(oxlint): improve cli doc regarding fix and -D all
closes #3944
1 parent 1965aa6 commit 955a4b4

File tree

3 files changed

+27
-26
lines changed

3 files changed

+27
-26
lines changed

apps/oxlint/src/command/lint.rs

+10-10
Original file line numberDiff line numberDiff line change
@@ -77,13 +77,13 @@ pub struct BasicOptions {
7777
/// Accumulate rules and categories from left to right on the command-line.
7878
/// For example `-D correctness -A no-debugger` or `-A all -D no-debugger`.
7979
/// The categories are:
80-
/// * `correctness` - code that is outright wrong or useless (default)
81-
/// * `suspicious` - code that is most likely wrong or useless
82-
/// * `pedantic` - lints which are rather strict or have occasional false positives
83-
/// * `style` - code that should be written in a more idiomatic way
84-
/// * `nursery` - new lints that are still under development
85-
/// * `restriction` - lints which prevent the use of language and library features
86-
/// * `all` - all the categories listed above except nursery
80+
/// * `correctness` - code that is outright wrong or useless (default).
81+
/// * `suspicious` - code that is most likely wrong or useless.
82+
/// * `pedantic` - lints which are rather strict or have occasional false positives.
83+
/// * `style` - code that should be written in a more idiomatic way.
84+
/// * `nursery` - new lints that are still under development.
85+
/// * `restriction` - lints which prevent the use of language and library features.
86+
/// * `all` - all the categories listed above except nursery. Does not enable plugins automatically.
8787
///
8888
/// Arguments:
8989
// ^ This shows up on the website but not from the cli's `--help`.
@@ -120,14 +120,14 @@ impl LintFilter {
120120
#[derive(Debug, Clone, Bpaf)]
121121
pub struct FixOptions {
122122
/// Fix as many issues as possible. Only unfixed issues are reported in the output
123-
#[bpaf(switch)]
123+
#[bpaf(switch, hide_usage)]
124124
pub fix: bool,
125125
/// Apply auto-fixable suggestions. May change program behavior.
126-
#[bpaf(switch)]
126+
#[bpaf(switch, hide_usage)]
127127
pub fix_suggestions: bool,
128128

129129
/// Apply dangerous fixes and suggestions.
130-
#[bpaf(switch)]
130+
#[bpaf(switch, hide_usage)]
131131
pub fix_dangerously: bool,
132132
}
133133

tasks/website/src/linter/snapshots/cli.snap

+8-8
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ expression: snapshot
66

77

88
## Usage
9-
**`oxlint`** \[**`-c`**=_`<./oxlintrc.json>`_\] \[**`--fix`**\] \[**`--fix-suggestions`**\] \[**`--fix-dangerously`**\] \[_`PATH`_\]...
9+
**`oxlint`** \[**`-c`**=_`<./oxlintrc.json>`_\] \[_`PATH`_\]...
1010

1111
## Basic Configuration
1212
- **`-c`**, **`--config`**=_`<./oxlintrc.json>`_ &mdash;
@@ -24,13 +24,13 @@ Accumulate rules and categories from left to right on the command-line.
2424

2525
For example `-D correctness -A no-debugger` or `-A all -D no-debugger`.
2626
The categories are:
27-
* `correctness` - code that is outright wrong or useless (default)
28-
* `suspicious` - code that is most likely wrong or useless
29-
* `pedantic` - lints which are rather strict or have occasional false positives
30-
* `style` - code that should be written in a more idiomatic way
31-
* `nursery` - new lints that are still under development
32-
* `restriction` - lints which prevent the use of language and library features
33-
* `all` - all the categories listed above except nursery
27+
* `correctness` - code that is outright wrong or useless (default).
28+
* `suspicious` - code that is most likely wrong or useless.
29+
* `pedantic` - lints which are rather strict or have occasional false positives.
30+
* `style` - code that should be written in a more idiomatic way.
31+
* `nursery` - new lints that are still under development.
32+
* `restriction` - lints which prevent the use of language and library features.
33+
* `all` - all the categories listed above except nursery. Does not enable plugins automatically.
3434

3535
Arguments:
3636

tasks/website/src/linter/snapshots/cli_terminal.snap

+9-8
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
source: tasks/website/src/linter/cli.rs
33
expression: snapshot
44
---
5-
Usage: [-c=<./oxlintrc.json>] [--fix] [--fix-suggestions] [--fix-dangerously] [PATH]...
5+
Usage: [-c=<./oxlintrc.json>] [PATH]...
66

77
Basic Configuration
88
-c, --config=<./oxlintrc.json> Oxlint configuration file (experimental)
@@ -15,13 +15,14 @@ Allowing / Denying Multiple Lints
1515
Accumulate rules and categories from left to right on the command-line.
1616
For example `-D correctness -A no-debugger` or `-A all -D no-debugger`.
1717
The categories are:
18-
* `correctness` - code that is outright wrong or useless (default)
19-
* `suspicious` - code that is most likely wrong or useless
20-
* `pedantic` - lints which are rather strict or have occasional false positives
21-
* `style` - code that should be written in a more idiomatic way
22-
* `nursery` - new lints that are still under development
23-
* `restriction` - lints which prevent the use of language and library features
24-
* `all` - all the categories listed above except nursery
18+
* `correctness` - code that is outright wrong or useless (default).
19+
* `suspicious` - code that is most likely wrong or useless.
20+
* `pedantic` - lints which are rather strict or have occasional false positives.
21+
* `style` - code that should be written in a more idiomatic way.
22+
* `nursery` - new lints that are still under development.
23+
* `restriction` - lints which prevent the use of language and library features.
24+
* `all` - all the categories listed above except nursery. Does not enable plugins
25+
automatically.
2526
-A, --allow=NAME Allow the rule or category (suppress the lint)
2627
-W, --warn=NAME Deny the rule or category (emit a warning)
2728
-D, --deny=NAME Deny the rule or category (emit an error)

0 commit comments

Comments
 (0)