diff --git a/ARCHITECTURE.md b/ARCHITECTURE.md index 1cbe3bd9b..9fa538c83 100644 --- a/ARCHITECTURE.md +++ b/ARCHITECTURE.md @@ -478,8 +478,8 @@ A feature does not have enough tags to define what it is. A feature has nonstandard tags. -* `deprecated_tags`: the feature has tags listed in `deprecated.json` or matches a preset with a `replacement` property -* `incomplete_tags`: the feature does not have all tags from the `addTags` property of its matching preset +* `deprecated_tags`: the feature has tags that should be replaced or removed, as specified in `deprecated.json` or the `replacement` property of a preset +* `incomplete_tags`: the feature has tags that indicate it should also have some other tags * `noncanonical_brand`: the feature indicates it should match a name-suggestion-index entry but does not have all of the given tags * `old_multipolygon`: the feature is a multipolygon relation with its defining tags set on its outer member way diff --git a/modules/validations/outdated_tags.js b/modules/validations/outdated_tags.js index 79c6ed91b..837697f67 100644 --- a/modules/validations/outdated_tags.js +++ b/modules/validations/outdated_tags.js @@ -32,7 +32,6 @@ export function validationOutdatedTags(context) { function oldTagIssues(entity, graph) { var oldTags = Object.assign({}, entity.tags); // shallow copy var preset = context.presets().match(entity, graph); - var explicitPresetUpgrade = preset.replacement; var subtype = 'deprecated_tags'; // upgrade preset.. @@ -58,9 +57,6 @@ export function validationOutdatedTags(context) { Object.keys(preset.addTags).forEach(function(k) { if (!newTags[k]) { newTags[k] = preset.addTags[k]; - if (!explicitPresetUpgrade) { - subtype = 'incomplete_tags'; - } } }); } @@ -121,15 +117,19 @@ export function validationOutdatedTags(context) { } } - // determine diff var tagDiff = utilTagDiff(oldTags, newTags); if (!tagDiff.length) return []; + var isOnlyAddingTags = tagDiff.every(function(d) { + return d.type === '+'; + }); + var prefix = ''; if (subtype === 'noncanonical_brand') { prefix = 'noncanonical_brand.'; - } else if (subtype === 'incomplete_tags') { + } else if (subtype === 'deprecated_tags' && isOnlyAddingTags) { + subtype = 'incomplete_tags'; prefix = 'incomplete.'; } @@ -181,9 +181,7 @@ export function validationOutdatedTags(context) { var messageID = 'issues.outdated_tags.' + prefix + 'message'; - if (subtype === 'noncanonical_brand' && tagDiff.every(function(d) { - return d.type === '+'; - })) { + if (subtype === 'noncanonical_brand' && isOnlyAddingTags) { messageID += '_incomplete'; }