-
Notifications
You must be signed in to change notification settings - Fork 40
CP-1140 Initial implementation of failing on analyzer hints #102
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -32,7 +32,11 @@ class AnalyzeCli extends TaskCli { | |
| negatable: true, | ||
| help: 'Treat non-type warnings as fatal.') | ||
| ..addFlag('hints', | ||
| defaultsTo: defaultHints, negatable: true, help: 'Show hint results.'); | ||
| defaultsTo: defaultHints, negatable: true, help: 'Show hint results.') | ||
| ..addFlag('fatal-hints', | ||
| defaultsTo: defaultFatalHints, | ||
| negatable: true, | ||
| help: 'Treat hints as fatal.'); | ||
|
|
||
| final String command = 'analyze'; | ||
|
|
||
|
|
@@ -41,10 +45,22 @@ class AnalyzeCli extends TaskCli { | |
| bool fatalWarnings = TaskCli.valueOf( | ||
| 'fatal-warnings', parsedArgs, config.analyze.fatalWarnings); | ||
| bool hints = TaskCli.valueOf('hints', parsedArgs, config.analyze.hints); | ||
| bool fatalHints = | ||
| TaskCli.valueOf('fatal-hints', parsedArgs, config.analyze.fatalHints); | ||
|
|
||
| if (!hints && fatalHints) { | ||
|
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. might be better to implement hints as an option instead of a flag with values of 'none', 'enabled', 'fatal'?
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I'm torn on this. I think I like that idea, but it could be confusing to make |
||
| return new CliResult.fail('You must enable hints to fail on hints.'); | ||
| } | ||
|
|
||
| AnalyzeTask task = analyze( | ||
| entryPoints: entryPoints, fatalWarnings: fatalWarnings, hints: hints); | ||
| reporter.logGroup(task.analyzerCommand, outputStream: task.analyzerOutput); | ||
| entryPoints: entryPoints, | ||
| fatalWarnings: fatalWarnings, | ||
| hints: hints, | ||
| fatalHints: fatalHints); | ||
| var title = task.analyzerCommand; | ||
| if (fatalHints) title += ' (treating hints as fatal)'; | ||
|
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. since fatal hints aren't an option for dartanalyzer (yet) I just wanted to tack this on to the output to differentiate it
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. since fatal hints aren't an option for dartanalyzer (yet) I just wanted to tack this on to the output to differentiate it from non-fatal hints
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 👍 |
||
|
|
||
| reporter.logGroup(title, outputStream: task.analyzerOutput); | ||
| await task.done; | ||
| return task.successful | ||
| ? new CliResult.success('Analysis completed.') | ||
|
|
||
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.
might be better to implement hints as an option instead of a flag with values of 'none', 'enabled', 'fatal'?