-
Notifications
You must be signed in to change notification settings - Fork 660
feat(rome_cli): expose the --verbose
flag to the CLI
#3812
Conversation
e72cc3e
to
072689c
Compare
✅ Deploy Preview for docs-rometools canceled.
|
Comparing feat(rome_cli): expose the
1 page testedHomeBrowser previews
Most significant changes27 other significant changes: JS Parse & Compile on Chrome Desktop, Largest Contentful Paint on Motorola Moto G Power, 3G connection, First Contentful Paint on Motorola Moto G Power, 3G connection, Total Blocking Time on Chrome Desktop, Time to Interactive on Motorola Moto G Power, 3G connection, Total CSS Size in Bytes on Chrome Desktop, Total CSS Size in Bytes on iPhone, 4G LTE, Total CSS Size in Bytes on Motorola Moto G Power, 3G connection, Total Page Size in Bytes on Chrome Desktop, Total Page Size in Bytes on iPhone, 4G LTE, Total Page Size in Bytes on Motorola Moto G Power, 3G connection, Time to Interactive on Chrome Desktop, First Contentful Paint on Chrome Desktop, Largest Contentful Paint on Chrome Desktop, Number of Requests on Motorola Moto G Power, 3G connection, Number of Requests on Chrome Desktop, Number of Requests on iPhone, 4G LTE, Speed Index on Motorola Moto G Power, 3G connection, Time to Interactive on iPhone, 4G LTE, Largest Contentful Paint on iPhone, 4G LTE, First Contentful Paint on iPhone, 4G LTE, Speed Index on Chrome Desktop, Total HTML Size in Bytes on Chrome Desktop, Total HTML Size in Bytes on iPhone, 4G LTE, Total HTML Size in Bytes on Motorola Moto G Power, 3G connection, Lighthouse Performance Score on Motorola Moto G Power, 3G connection, Lighthouse Performance Score on Chrome Desktop Calibre: Site dashboard | View this PR | Edit settings | View documentation |
Parser conformance results on ubuntu-latestjs/262
jsx/babel
symbols/microsoft
ts/babel
ts/microsoft
|
@@ -37,6 +37,7 @@ const CHECK: Markup = markup! { | |||
"<Dim>"--apply"</Dim>" Apply safe fixes | |||
"<Dim>"--apply-suggested"</Dim>" Apply safe and suggested fixes | |||
"<Dim>"--max-diagnostics"</Dim>" Cap the amount of diagnostics displayed (default: 20) | |||
"<Dim>"--verbose"</Dim>" Print additional verbose advices on diagnostics |
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
and format
can print diagnostics since Termination
hasn't been migrated to the diagnostic system yet. But yes eventually I think this will become a global flag for the CLI
@@ -889,7 +889,7 @@ mod tests { | |||
..TestDiagnostic::empty() | |||
}; | |||
|
|||
let diag = markup!({ PrintDiagnostic(&diag) }).to_owned(); | |||
let diag = markup!({ PrintDiagnostic(&diag, true) }).to_owned(); |
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.
The true
isn't very self explanatory. How about a PrintDiagnostic::verbose()
and PrintDiagnostic::non_verbose()
072689c
to
65d6304
Compare
@leops if you're able to fix the CI and merge it, I might be able to use this new feature for the suppression comments actions. |
65d6304
to
fabbe82
Compare
* upstream/main: (73 commits) fix(semantic_analyzers): style/noShoutyConstants does not recognize multiple uses of a constant. (rome#3789) feat(rome_js_analyze): useDefaultSwitchClauseLast (rome#3791) chore: run rustfmt and typo fix (rome#3840) feat(rome_js_analyze): use exhaustive deps support properties (rome#3581) website(docs): Fix text formatting (rome#3828) feat(rome_js_analyze): `noVoidTypeReturn` (rome#3806) feat(rome_cli): expose the `--verbose` flag to the CLI (rome#3812) fix(rome_diagnostics): allow diagnostic locations to be created without a resource (rome#3834) feat(rome_js_analyze): add noExtraNonNullAssertion rule (rome#3797) fix(rome_lsp): lsp friendly catch unwind (rome#3740) feat(rome_js_semantic): model improvements (rome#3825) feat(rome_json_parser): JSON Lexer (rome#3809) feat(rome_js_analyze): implement `noDistractingElements` (rome#3820) fix(rome_js_formatter): shothanded named import line break with default import (rome#3826) feat(rome_js_analyze): `noConstructorReturn` (rome#3805) feat(website): change enabledNurseryRules to All/Recommended select (rome#3810) feat(rome_js_analyze): noSetterReturn feat(rome_js_analyze): noConstructorReturn feat(rome_analyze): suppress rule via code actions (rome#3572) feat(rome_js_analyze): `noVar` (rome#3765) ...
Summary
Verbose advices on diagnostics are currently unused, as they always get printed when the diagnostic is displayed with
PrintDiagnostic
. This PR adds a second argument to the diagnostics printer to configure whether verbose advices should be printed, and exposes this setting as the--verbose
flag on the relevant CLI commands (check
,ci
andformat
).Test Plan
I've added a few tests to ensure the CLI correctly accepts the new argument. Since we don't have any diagnostic making use of verbose advices yet it doesn't really make a difference in the output though.