Skip to content
This repository was archived by the owner on Nov 20, 2024. It is now read-only.

move cli main into lib/ #1114

Merged
merged 1 commit into from
Aug 7, 2018
Merged

move cli main into lib/ #1114

merged 1 commit into from
Aug 7, 2018

Conversation

pq
Copy link
Contributor

@pq pq commented Aug 7, 2018


if (customPackageRoot != null && packageConfigFile != null) {
errorSink.write("Cannot specify both '--package-root' and '--packages'.");
exitCode = unableToProcessExitCode;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

pro tip: return the exit code from this method – set it in bin. Makes testing MUCH easier.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great point. That said, I think these cases are pretty well covered in our integration tests. Are you making a general point or do you see cases we're missing?

// ignore: avoid_catches_without_on_clauses
} catch (err, stack) {
errorSink.writeln('''An error occurred while linting
Please report it at: github.com/dart-lang/linter/issues
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Move this catch to bin – makes testing easier

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

...make sure to set the exit code to an error!

@kevmoo
Copy link
Contributor

kevmoo commented Aug 7, 2018 via email

@pq
Copy link
Contributor Author

pq commented Aug 7, 2018

Thanks @kevmoo! I think our integration tests cover the exit code cases pretty well as is but I'll look at our updated coverage results after this lands and see if a refactor is in order.

As for the general point, it's a good one. In the short to medium term I'm hoping this code will go away altogether (see dart-lang/sdk#57427). If it doesn't maybe we can rejigger it a bit.

Cheers!

@pq pq requested a review from bwilkerson August 7, 2018 19:21
@pq pq merged commit 5102fc5 into master Aug 7, 2018
@pq pq deleted the refactor_cli_main branch August 7, 2018 19:47
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Development

Successfully merging this pull request may close these issues.

4 participants