-
Notifications
You must be signed in to change notification settings - Fork 125
Add automatic SDK warning comparison between versions to dartdoc #1572
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
Conversation
…oizer+flutter_auto_integrate
} | ||
|
||
/// Output formatter for comparing warnings. | ||
String printWarningDelta(String title, String dartdocOriginalBranch, |
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.
Is this public for testing?
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.
It's "public" so it can be imported by grinder. It's not public in another sense, that being it is under lib/src.
Map<String, int> original, Map<String, int> current) { | ||
StringBuffer printBuffer = new StringBuffer(); | ||
Set<String> quantityChangedOuts = new Set(); | ||
Set<String> onlyOriginal = new Set(); |
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.
I think you can calculate these using Set.difference()
?
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.
I could, but I would have to build more sets and then throw them away to do so. Map.keys is an iterable, not a set. Since I have to traverse by hand once anyway since "quantityChangedOuts" isn't something computable by difference, it seemed reasonable to do so for all three and save the throwaway Sets.
/// Version of dartdoc we should use when making comparisons. | ||
String get dartdocOriginalBranch { | ||
String branch = 'master'; | ||
if (Platform.environment.containsKey('DARTDOC_ORIGINAL')) { |
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.
warn (or log?) when pulling from an env variable, so people remember they've set it?
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.
done.
…oizer+sdk_warnings_compare
Add a new grind target, compare-sdk-warnings, that will take the version of dartdoc in the CWD and compare it running against the same SDK to another version specified by git branch or tag in the environment variable DARTDOC_ORIGINAL. Moves _SubprocessLauncher out into io_utils and adds json parsing support to it for the warning comparison.