Skip to content

Commit 6da9eea

Browse files
Famlamfrodrigo
authored andcommitted
Don't require an integer for capacity:note
Disable the 'not an integer' warning for `capacity:note` (currently 1519 cases worldwide). I've also whitelisted a few other similar keys
1 parent 198072b commit 6da9eea

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

plugins/Capacity.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -108,8 +108,8 @@ def node(self, data, tags):
108108
for key, value in tags.items():
109109
if (
110110
not key.startswith("capacity:")
111-
# Ignore errors that should be reported by generic prefix analysers
112-
or key == "capacity:"
111+
# Ignore errors that should be reported by generic prefix analysers, and note/fixme/source tags
112+
or key.lower().endswith((":", ":note", ":fixme", ":source"))
113113
or value in ("", "yes", "no", "unknown")
114114
):
115115
continue
@@ -193,8 +193,9 @@ def test(self):
193193
assert not a.node(None, {"capacity:": "1"})
194194
assert not a.node(None, {"capacity:": ""})
195195
assert not a.node(None, {"capacity": ""})
196-
197196
assert not a.node(None, {"capacity": "1", "capacity:": "a"})
197+
assert not a.node(None, {"capacity": "1", "capacity:note": "Only for blue cars"})
198+
198199
assert not a.node(None, {"capacity:wheelchair": "1"})
199200

200201
assert not a.node(None, {"capacity": "123.45 l", "new_tag": "something_storage_related_not_whitelisted_yet"})

0 commit comments

Comments
 (0)