This repository has been archived by the owner on Aug 31, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 660
feat(rome_cli): expose the --verbose
flag to the CLI
#3812
Merged
Merged
Changes from all commits
Commits
Show all changes
4 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
56 changes: 56 additions & 0 deletions
56
crates/rome_cli/tests/snapshots/main_commands_check/print_verbose.snap
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
--- | ||
source: crates/rome_cli/tests/snap_test.rs | ||
expression: content | ||
--- | ||
## `check.js` | ||
|
||
```js | ||
for(;true;); | ||
|
||
``` | ||
|
||
# Termination Message | ||
|
||
```block | ||
some errors were emitted while running checks | ||
``` | ||
|
||
# Emitted Messages | ||
|
||
```block | ||
check.js:1:1 lint/correctness/useWhile FIXABLE ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ | ||
|
||
× Use while loops instead of for loops. | ||
|
||
> 1 │ for(;true;); | ||
│ ^^^^^^^^^^^ | ||
2 │ | ||
|
||
i Suggested fix: Use a while loop | ||
|
||
1 │ - for(;true;); | ||
1 │ + while·(true); | ||
2 2 │ | ||
|
||
|
||
``` | ||
|
||
```block | ||
check.js:1:1 lint/style/useBlockStatements FIXABLE ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ | ||
|
||
× Block statements are preferred in this position. | ||
|
||
> 1 │ for(;true;); | ||
│ ^^^^^^^^^^^^ | ||
2 │ | ||
|
||
i Suggested fix: Wrap the statement with a `JsBlockStatement` | ||
|
||
1 │ - for(;true;); | ||
1 │ + for(;true;)·{} | ||
2 2 │ | ||
|
||
|
||
``` | ||
|
||
|
56 changes: 56 additions & 0 deletions
56
crates/rome_cli/tests/snapshots/main_commands_ci/print_verbose.snap
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
--- | ||
source: crates/rome_cli/tests/snap_test.rs | ||
expression: content | ||
--- | ||
## `ci.js` | ||
|
||
```js | ||
for(;true;); | ||
|
||
``` | ||
|
||
# Termination Message | ||
|
||
```block | ||
some errors were emitted while running checks | ||
``` | ||
|
||
# Emitted Messages | ||
|
||
```block | ||
ci.js:1:1 lint/correctness/useWhile FIXABLE ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ | ||
|
||
× Use while loops instead of for loops. | ||
|
||
> 1 │ for(;true;); | ||
│ ^^^^^^^^^^^ | ||
2 │ | ||
|
||
i Suggested fix: Use a while loop | ||
|
||
1 │ - for(;true;); | ||
1 │ + while·(true); | ||
2 2 │ | ||
|
||
|
||
``` | ||
|
||
```block | ||
ci.js:1:1 lint/style/useBlockStatements FIXABLE ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ | ||
|
||
× Block statements are preferred in this position. | ||
|
||
> 1 │ for(;true;); | ||
│ ^^^^^^^^^^^^ | ||
2 │ | ||
|
||
i Suggested fix: Wrap the statement with a `JsBlockStatement` | ||
|
||
1 │ - for(;true;); | ||
1 │ + for(;true;)·{} | ||
2 2 │ | ||
|
||
|
||
``` | ||
|
||
|
25 changes: 25 additions & 0 deletions
25
crates/rome_cli/tests/snapshots/main_commands_format/print_verbose.snap
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
--- | ||
source: crates/rome_cli/tests/snap_test.rs | ||
expression: content | ||
--- | ||
## `format.js` | ||
|
||
```js | ||
statement( ) | ||
``` | ||
|
||
# Emitted Messages | ||
|
||
```block | ||
format.js format ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ | ||
|
||
i Formatter would have printed the following content: | ||
|
||
1 │ - ··statement(··)·· | ||
1 │ + statement(); | ||
2 │ + | ||
|
||
|
||
``` | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think the
--verbose
argument should be global. Much like--colors
.Any command can emit diagnostics, hence any diagnostic can have, theoretically, verbose advice.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Well at the moment only
check
,ci
andformat
can print diagnostics sinceTermination
hasn't been migrated to the diagnostic system yet. But yes eventually I think this will become a global flag for the CLI