Open danielgomezrico opened 3 years ago
This would be awesome , i am starting to look into this
I have added the code below, however i am looking how best to check for errors when the function is called, as it's a void and does not return any errors. Perhaps we could change this to be more like format
?
argParser.addFlag(
'set-exit-if-error',
negatable: true,
hide: !verboseHelp,
help: 'The path to write the request and response protocol. This is '
'only intended to be used for debugging the tooling.',
);
@TahaTesser Can you look over my question and give your thoughts on implementation? we may need to convert the void function to return a status code for errors.
Is there any follow-up on this?
Use case
I would like to use the tool
flutter analyze
on our CI workflow, so, if we get a failure (fatal) from the linter the CI fails.Currently, I can list all the outputs, fatal, warnings, and infos, but I don't have an out-of-the-box way to make it run an
exit
so the bash scripts on CI fails.Proposal
This out of the box way already exists on
flutter format
tool and is--set-exit-if-changed
, it fails if something needs to be changed, it would be awesome to have an option like this one but forflutter analyze
, maybe:set-exit-if-fatal
set-exit-if-warning
set-exit-if-info
set-exit-if-any-fails
One way to do it is with a bash script but is not out of the box using Flutter 2 (https://github.com/flutter/flutter/issues/20855):