Add ignored warning counts to the changeset tags (close #6123)

This commit is contained in:
Quincy Morgan
2019-03-28 09:46:59 -04:00
parent 3896b2282f
commit f4367f96c0
+14 -1
View File
@@ -24,7 +24,8 @@ var readOnlyTags = [
/^ideditor:/,
/^imagery_used$/,
/^host$/,
/^locale$/
/^locale$/,
/^warnings:/
];
// treat most punctuation (except -, _, +, &) as hashtag delimiters - #4398
@@ -114,6 +115,18 @@ export function uiCommit(context) {
}
}
var warningCountsByType = {};
context.validator().getWarnings().forEach(function(warning) {
// deletion count can be derived so don't tag that warning in the changeset
if (warning.type === 'many_deletions') return;
if (!warningCountsByType[warning.type]) warningCountsByType[warning.type] = 0;
warningCountsByType[warning.type] += 1;
});
for (var warningType in warningCountsByType) {
// tag the counts of warnings ignored by the user
tags['warnings:' + warningType] = warningCountsByType[warningType].toString();
}
_changeset = _changeset.update({ tags: tags });
var header = selection.selectAll('.header')