From f2e3426fbfc476b1f4adce65de65a88a9d0c1844 Mon Sep 17 00:00:00 2001 From: Famlam Date: Sat, 28 Dec 2024 15:07:20 +0100 Subject: [PATCH] Remove overlapping JOSM rule Our rules are stricter than JOSM --- mapcss/item_map.py | 2 +- plugins/Josm_deprecated.py | 35 +++-------------------------------- 2 files changed, 4 insertions(+), 33 deletions(-) diff --git a/mapcss/item_map.py b/mapcss/item_map.py index f0924cf24..5314bdfee 100644 --- a/mapcss/item_map.py +++ b/mapcss/item_map.py @@ -210,7 +210,6 @@ 'Unusual key {0}, maybe {1} or {2} is meant': 9002021, 'Wrong usage of {0} tag. Remove {1}, because it is clear that the name is missing even without an additional tag.': 9002005, 'deprecated tagging': 9002001, - 'key with uncommon character': 9002011, 'misspelled value': 9002018, 'questionable key (ending with a number)': 9002014, 'uncommon short key': 9002012, @@ -230,6 +229,7 @@ 590643159, 1089331760, 1116761280, + 1752615188, 1052866123, 1825345743, 690512681, diff --git a/plugins/Josm_deprecated.py b/plugins/Josm_deprecated.py index c98e40b39..8d7420bc4 100644 --- a/plugins/Josm_deprecated.py +++ b/plugins/Josm_deprecated.py @@ -21,7 +21,6 @@ def init(self, logger): self.errors[9002005] = self.def_class(item = 9002, level = 3, tags = ["tag", "deprecated"], title = mapcss.tr('Wrong usage of {0} tag. Remove {1}, because it is clear that the name is missing even without an additional tag.', mapcss._tag_uncapture(capture_tags, '{0.key}'), mapcss._tag_uncapture(capture_tags, '{0.tag}'))) self.errors[9002006] = self.def_class(item = 9002, level = 3, tags = ["tag", "deprecated"], title = mapcss.tr('{0} is unspecific. Instead use the key fixme with the information what exactly should be fixed in the value of fixme.', mapcss._tag_uncapture(capture_tags, '{0.tag}'))) self.errors[9002007] = self.def_class(item = 9002, level = 3, tags = ["tag", "deprecated"], title = mapcss.tr('{0}={1} is unspecific. Please replace \'\'{1}\'\' by a specific value.', mapcss._tag_uncapture(capture_tags, '{0.key}'), mapcss._tag_uncapture(capture_tags, '{0.value}'))) - self.errors[9002011] = self.def_class(item = 9002, level = 3, tags = ["tag", "deprecated"], title = mapcss.tr('key with uncommon character')) self.errors[9002012] = self.def_class(item = 9002, level = 3, tags = ["tag", "deprecated"], title = mapcss.tr('uncommon short key')) self.errors[9002014] = self.def_class(item = 9002, level = 3, tags = ["tag", "deprecated"], title = mapcss.tr('questionable key (ending with a number)')) self.errors[9002016] = self.def_class(item = 9002, level = 3, tags = ["tag", "deprecated"], title = mapcss.tr('{0} is not recommended. Use the Reverse Ways function from the Tools menu.', mapcss._tag_uncapture(capture_tags, '{0.tag}'))) @@ -52,7 +51,6 @@ def init(self, logger): self.re_5ee0acf2 = re.compile(r'josm\/ignore') self.re_6029fe03 = re.compile(r'^diaper:') self.re_61b0be1b = re.compile(r'^(buoy_cardinal|buoy_installation|buoy_isolated_danger|buoy_lateral|buoy_safe_water|buoy_special_purpose|mooring)$') - self.re_620f4d52 = re.compile(r'=|\+|\/|&|<|>|;|\'|\"|%|#|@|\\|,|\.|\{|\}|\?|\*|\^|\$') self.re_69ec353a = re.compile(r'^is_in:') self.re_6d27b157 = re.compile(r'^description_[0-9]$') self.re_787405b1 = re.compile(r'^(yes|no|limited)$') @@ -1181,16 +1179,7 @@ def node(self, data, tags): err.append({'class': 9002001, 'subclass': 1390370717, 'text': mapcss.tr('{0} is deprecated', mapcss._tag_uncapture(capture_tags, '{0.key}'))}) # *[/=|\+|\/|&|<|>|;|'|"|%|#|@|\\|,|\.|\{|\}|\?|\*|\^|\$/] - if True: - match = False - if not match: - capture_tags = {} - try: match = ((mapcss._tag_capture(capture_tags, 0, tags, self.re_620f4d52))) - except mapcss.RuleAbort: pass - if match: - # group:tr("key with uncommon character") - # throwWarning:tr("{0}","{0.key}") - err.append({'class': 9002011, 'subclass': 1752615188, 'text': mapcss.tr('{0}', mapcss._tag_uncapture(capture_tags, '{0.key}'))}) + # Rule Blacklisted (id: 1752615188) # *[/^.$/] # node[/^..$/][!kp][!pk] @@ -5709,16 +5698,7 @@ def way(self, data, tags, nds): err.append({'class': 9002001, 'subclass': 1390370717, 'text': mapcss.tr('{0} is deprecated', mapcss._tag_uncapture(capture_tags, '{0.key}'))}) # *[/=|\+|\/|&|<|>|;|'|"|%|#|@|\\|,|\.|\{|\}|\?|\*|\^|\$/] - if True: - match = False - if not match: - capture_tags = {} - try: match = ((mapcss._tag_capture(capture_tags, 0, tags, self.re_620f4d52))) - except mapcss.RuleAbort: pass - if match: - # group:tr("key with uncommon character") - # throwWarning:tr("{0}","{0.key}") - err.append({'class': 9002011, 'subclass': 1752615188, 'text': mapcss.tr('{0}', mapcss._tag_uncapture(capture_tags, '{0.key}'))}) + # Rule Blacklisted (id: 1752615188) # *[/^.$/] # way[/^..$/][route=ferry][!to] @@ -10154,16 +10134,7 @@ def relation(self, data, tags, members): err.append({'class': 9002001, 'subclass': 1390370717, 'text': mapcss.tr('{0} is deprecated', mapcss._tag_uncapture(capture_tags, '{0.key}'))}) # *[/=|\+|\/|&|<|>|;|'|"|%|#|@|\\|,|\.|\{|\}|\?|\*|\^|\$/] - if True: - match = False - if not match: - capture_tags = {} - try: match = ((mapcss._tag_capture(capture_tags, 0, tags, self.re_620f4d52))) - except mapcss.RuleAbort: pass - if match: - # group:tr("key with uncommon character") - # throwWarning:tr("{0}","{0.key}") - err.append({'class': 9002011, 'subclass': 1752615188, 'text': mapcss.tr('{0}', mapcss._tag_uncapture(capture_tags, '{0.key}'))}) + # Rule Blacklisted (id: 1752615188) # *[/^.$/] # relation[/^..$/][!to]