This repository was archived by the owner on Aug 31, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 653
feat(rome_cli): termination as diagnostic #4058
Merged
Merged
Conversation
This file contains hidden or 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
✅ Deploy Preview for docs-rometools ready!
To edit notification comments on pull requests, go to your Netlify site settings. |
b8529d8
to
0fbdd42
Compare
Parser conformance results on ubuntu-latestjs/262
jsx/babel
symbols/microsoft
ts/babel
ts/microsoft
|
Your plan has been cancelledChoose a plan to resume monitoring your Sites and Pull Requests. If you need help, check the Manage Your Plan and Test Usage guide. |
leops
reviewed
Dec 19, 2022
4542c1f
to
9acd081
Compare
leops
approved these changes
Dec 21, 2022
cd5f559
to
53e4148
Compare
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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.
Summary
This PR makes
Termination
aDiagnostic
so that errors emitted from the CLI can be printed nicely using our diagnostic infrastructure.To achieve that, the following changes have been made:
Termination
is now calledCliDiagnostic
, it's anenum
and it manually implementsDiagnostic
.CliDiagnostic
are now implemented via functions.RomeError
has been renamed toWorkspaceError
CliDiagnostic
aDiagnostic
comes with a constraint where, to print it, we need aConsole
type. NowCliSession::new
accepts a mutable reference toConsole
. TheConsole
object gets created at the beginning ofrome_cli/src/main.rs#main
and then passed toCliSession
. This change is also reflected in the test suite, unfortunately.Error
now implements the std traitTermination
and returnsExitCode::FAILURE
if the severity is>= Severity::Error
.main()
function now returnsExitCode
thiserror
crate is removedTest Plan
I manually checked the snapshots and checked that they were correct.
I also ran some error cases locally and ensured that the CLI worked as expected.
Documentation