Skip to content

Commit

Permalink
Don't require an integer for capacity:note
Browse files Browse the repository at this point in the history
Disable the 'not an integer' warning for `capacity:note` (currently 1519 cases worldwide). I've also whitelisted a few other similar keys
  • Loading branch information
Famlam authored and frodrigo committed Jul 25, 2024
1 parent 198072b commit 6da9eea
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions plugins/Capacity.py
Original file line number Diff line number Diff line change
Expand Up @@ -108,8 +108,8 @@ def node(self, data, tags):
for key, value in tags.items():
if (
not key.startswith("capacity:")
# Ignore errors that should be reported by generic prefix analysers
or key == "capacity:"
# Ignore errors that should be reported by generic prefix analysers, and note/fixme/source tags
or key.lower().endswith((":", ":note", ":fixme", ":source"))
or value in ("", "yes", "no", "unknown")
):
continue
Expand Down Expand Up @@ -193,8 +193,9 @@ def test(self):
assert not a.node(None, {"capacity:": "1"})
assert not a.node(None, {"capacity:": ""})
assert not a.node(None, {"capacity": ""})

assert not a.node(None, {"capacity": "1", "capacity:": "a"})
assert not a.node(None, {"capacity": "1", "capacity:note": "Only for blue cars"})

assert not a.node(None, {"capacity:wheelchair": "1"})

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

0 comments on commit 6da9eea

Please sign in to comment.