Skip to content

Commit

Permalink
Remove overlapping JOSM rule
Browse files Browse the repository at this point in the history
Our rules are stricter than JOSM
  • Loading branch information
Famlam committed Dec 28, 2024
1 parent 7dc0772 commit f2e3426
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 33 deletions.
2 changes: 1 addition & 1 deletion mapcss/item_map.py
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand All @@ -230,6 +229,7 @@
590643159,
1089331760,
1116761280,
1752615188,
1052866123,
1825345743,
690512681,
Expand Down
35 changes: 3 additions & 32 deletions plugins/Josm_deprecated.py
Original file line number Diff line number Diff line change
Expand Up @@ -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}')))
Expand Down Expand Up @@ -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)$')
Expand Down Expand Up @@ -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]
Expand Down Expand Up @@ -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]
Expand Down Expand Up @@ -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]
Expand Down

0 comments on commit f2e3426

Please sign in to comment.