Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Better handling for multiple globs #58

Merged
merged 1 commit into from
Nov 4, 2021
Merged

Conversation

jhaber
Copy link
Member

@jhaber jhaber commented Nov 4, 2021

Related to #50

Previously we would ignore status code 2 if it was caused by no matching files. However, since we're passing multiple globs, this isn't a reliably strategy. If any glob doesn't match, we'll get status code 2 and the "no matching files" message will print. However, that doesn't tell us anything about the other globs. They could have incorrectly formatted files, parsing errors, or potentially not even have a parser defined at all.

This PR makes it so that if prettier prints an error log, this will flip a boolean (unless it's a "no files matching" message). If prettier returns a non-0 status code and this boolean is flipped, then we'll fail the Maven plugin execution.

@magisyn

@jhaber
Copy link
Member Author

jhaber commented Nov 4, 2021

The logic is here is getting pretty gnarly, and trying to ensure it works across versions of prettier is a pain (because output changes between versions, and we rely on parsing output). I need to get integration testing set up with maven-invoker soon

@jhaber jhaber merged commit b61015a into master Nov 4, 2021
@jhaber jhaber deleted the handle-multiple-globs-better branch November 4, 2021 14:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant