Skip to content

Commit

Permalink
Merge pull request #5275 from SilentSpike/keep-right-regex
Browse files Browse the repository at this point in the history
[KeepRight] Use regex group capture to extract error details
  • Loading branch information
thomas-hervey authored Sep 5, 2018
2 parents 74e06d4 + a8f3311 commit ee35037
Show file tree
Hide file tree
Showing 4 changed files with 339 additions and 191 deletions.
39 changes: 24 additions & 15 deletions data/core.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -688,13 +688,22 @@ en:
description: 'This node is very close but not connected to way #{var1}.'
_70:
title: 'missing tags'
description: 'This {var1} has an empty tag: {var2}.'
description: 'This {var1} has an empty tag: "{var2}".'
_71:
title: 'way without tags'
description: 'This way has no tags.'
_72:
title: 'node without tags'
description: 'This node is not member of any way and doesn''t have any tags.'
_73:
title: 'tracktype with no highway tag'
description: 'This way has a "tracktype" tag but no "highway" tag.'
_74:
title: 'empty tag'
description: 'This {var1} has an empty tag: "{var2}".'
_75:
title: 'name without tags'
description: 'This {var1} has a name ("{var2}") but no other tags.'
_90:
title: 'motorways without ref'
description: 'This way is tagged as motorway and therefore needs a ref nat_ref or int_ref tag.'
Expand Down Expand Up @@ -781,16 +790,16 @@ en:
description: 'These errors contain self intersecting ways.'
_211:
title: ''
description: 'This way contains more than one node at least twice. Nodes are {var1}. This may or may not be an error.'
description: 'This way contains more than one node multiple times. Nodes are {var1}. This may or may not be an error.'
_212:
title: ''
description: 'This way has only two different nodes and contains one of them more than once.'
_220:
title: 'misspelled tags'
description: 'This {var1} is tagged {var2}={var3} where {var4} looks like {var5}.'
description: 'This {var1} is tagged "{var2}"="{var3}" where "{var4}" looks like "{var5}".'
_221:
title: ''
description: 'The key of this {var1} tag is key {var2}.'
description: 'This {var1} has a tag with key "key"="{var2}".'
_230:
title: 'layer conflicts'
description: ''
Expand Down Expand Up @@ -829,16 +838,16 @@ en:
description: 'This turn-restriction has no known restriction type.'
_292:
title: 'missing from way'
description: 'A turn-restriction needs exactly one {var1} member. This one has {var2}.'
description: 'A turn-restriction needs exactly one "from" member. This one has {var1}.'
_293:
title: 'missing to way'
description: 'A turn-restriction needs exactly one {var1} member. This one has {var2}.'
description: 'A turn-restriction needs exactly one "to" member. This one has {var1}.'
_294:
title: 'from or to not a way'
description: 'From- and To-members of turn restrictions need to be ways. {var1}.'
description: '"from" and "to" members of turn restrictions need to be ways. {var1}.'
_295:
title: 'via is not on the way ends'
description: 'via (node #{var1}) is not the first or the last member of from (way #{var2}).'
description: '"via" (node #{var1}) is not the first or the last member of "from" (way #{var2}).'
_296:
title: 'wrong restriction angle'
description: 'restriction type is {var1} but angle is {var2} degrees. Maybe the restriction type is not appropriate?'
Expand All @@ -856,10 +865,10 @@ en:
description: 'This way is part of a roundabout but is not closed-loop. (split carriageways approaching a roundabout should not be tagged as roundabout).'
_312:
title: 'wrong direction'
description: 'If this roundabout is in a country with right-hand traffic then its orientation goes the wrong way around | If this roundabout is in a country with left-hand traffic then its orientation goes the wrong way around | If this mini_roundabout is in a country with right-hand traffic then its orientation goes the wrong way around | If this mini_roundabout is in a country with left-hand traffic then its orientation goes the wrong way around.'
description: 'If this {var1} is in a country with {var2}-hand traffic then its orientation goes the wrong way around'
_313:
title: 'faintly connected'
description: 'This roundabout has only {var1} other roads connected. Roundabouts typically have three.'
description: 'This roundabout has only {var1} other road(s) connected. Roundabouts typically have 3 or more.'
_320:
title: '*_link connections'
description: 'This way is tagged as highway={var1}_link but doesn''t have a connection to any other {var1} or {var1}_link.'
Expand All @@ -868,16 +877,16 @@ en:
description: 'This bridge doesn''t have a tag in common with its surrounding ways that shows the purpose of this bridge. There should be one of these tags: {var1}.'
_370:
title: 'doubled places'
description: 'This node has tags in common with the surrounding way #{var1} and seems to be redundand | This node has tags in common with the surrounding way #{var1} (including the name {var2}) and seems to be redundand.'
description: 'This node has tags in common with the surrounding way #{var1} {var2}and seems to be redundant'
_380:
title: 'non-physical use of sport-tag'
description: 'This way is tagged {var1} but has no physical tag like e.g. leisure, building, amenity or highway.'
description: 'This way is tagged "sport"="{var1}" but has no physical tag like e.g. leisure, building, amenity or highway.'
_400:
title: 'geometry glitches'
description: ''
_401:
title: 'missing turn restriction'
description: 'ways {var1} and {var2} join in a very sharp angle here and there is no oneway tag or turn restriction that prevents turning from way {var1} to {var2}.'
description: 'ways {var1} and {var2} join in a very sharp angle here and there is no oneway tag or turn restriction that prevents turning from way {var3} to {var4}.'
_402:
title: 'impossible angles'
description: 'this way bends in a very sharp angle here.'
Expand All @@ -899,13 +908,13 @@ en:
description: 'There is more than one node in this spot. Offending node IDs: {var1}.'
_60:
title: 'depreciated tags'
description: 'This {var1} uses deprecated tag {var2}={var3}. Please use {var4} instead!'
description: 'This {var1} uses deprecated tag "{var2}"="{var3}". Please use {var4} instead!'
_300:
title: 'missing maxspeed'
description: 'missing maxspeed tag.'
_360:
title: 'language unknown'
description: 'It would be nice if this {var1} had an additional tag name:XX={var2} where XX shows the language of its name {var2}.'
description: 'It would be nice if this {var1} had an additional tag "name:XX"="{var2}" where XX shows the language of its name "{var2}".'
_390:
title: 'missing tracktype'
description: This track doesn't have a tracktype.
Expand Down
42 changes: 27 additions & 15 deletions dist/locales/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -833,7 +833,7 @@
},
"_70": {
"title": "missing tags",
"description": "This {var1} has an empty tag: {var2}."
"description": "This {var1} has an empty tag: \"{var2}\"."
},
"_71": {
"title": "way without tags",
Expand All @@ -843,6 +843,18 @@
"title": "node without tags",
"description": "This node is not member of any way and doesn't have any tags."
},
"_73": {
"title": "tracktype with no highway tag",
"description": "This way has a \"tracktype\" tag but no \"highway\" tag."
},
"_74": {
"title": "empty tag",
"description": "This {var1} has an empty tag: \"{var2}\"."
},
"_75": {
"title": "name without tags",
"description": "This {var1} has a name (\"{var2}\") but no other tags."
},
"_90": {
"title": "motorways without ref",
"description": "This way is tagged as motorway and therefore needs a ref nat_ref or int_ref tag."
Expand Down Expand Up @@ -957,19 +969,19 @@
},
"_211": {
"title": "",
"description": "This way contains more than one node at least twice. Nodes are {var1}. This may or may not be an error."
"description": "This way contains more than one node multiple times. Nodes are {var1}. This may or may not be an error."
},
"_212": {
"title": "",
"description": "This way has only two different nodes and contains one of them more than once."
},
"_220": {
"title": "misspelled tags",
"description": "This {var1} is tagged {var2}={var3} where {var4} looks like {var5}."
"description": "This {var1} is tagged \"{var2}\"=\"{var3}\" where \"{var4}\" looks like \"{var5}\"."
},
"_221": {
"title": "",
"description": "The key of this {var1} tag is key {var2}."
"description": "This {var1} has a tag with key \"key\"=\"{var2}\"."
},
"_230": {
"title": "layer conflicts",
Expand Down Expand Up @@ -1021,19 +1033,19 @@
},
"_292": {
"title": "missing from way",
"description": "A turn-restriction needs exactly one {var1} member. This one has {var2}."
"description": "A turn-restriction needs exactly one \"from\" member. This one has {var1}."
},
"_293": {
"title": "missing to way",
"description": "A turn-restriction needs exactly one {var1} member. This one has {var2}."
"description": "A turn-restriction needs exactly one \"to\" member. This one has {var1}."
},
"_294": {
"title": "from or to not a way",
"description": "From- and To-members of turn restrictions need to be ways. {var1}."
"description": "\"from\" and \"to\" members of turn restrictions need to be ways. {var1}."
},
"_295": {
"title": "via is not on the way ends",
"description": "via (node #{var1}) is not the first or the last member of from (way #{var2})."
"description": "\"via\" (node #{var1}) is not the first or the last member of \"from\" (way #{var2})."
},
"_296": {
"title": "wrong restriction angle",
Expand All @@ -1057,11 +1069,11 @@
},
"_312": {
"title": "wrong direction",
"description": "If this roundabout is in a country with right-hand traffic then its orientation goes the wrong way around | If this roundabout is in a country with left-hand traffic then its orientation goes the wrong way around | If this mini_roundabout is in a country with right-hand traffic then its orientation goes the wrong way around | If this mini_roundabout is in a country with left-hand traffic then its orientation goes the wrong way around."
"description": "If this {var1} is in a country with {var2}-hand traffic then its orientation goes the wrong way around"
},
"_313": {
"title": "faintly connected",
"description": "This roundabout has only {var1} other roads connected. Roundabouts typically have three."
"description": "This roundabout has only {var1} other road(s) connected. Roundabouts typically have 3 or more."
},
"_320": {
"title": "*_link connections",
Expand All @@ -1073,19 +1085,19 @@
},
"_370": {
"title": "doubled places",
"description": "This node has tags in common with the surrounding way #{var1} and seems to be redundand | This node has tags in common with the surrounding way #{var1} (including the name {var2}) and seems to be redundand."
"description": "This node has tags in common with the surrounding way #{var1} {var2}and seems to be redundant"
},
"_380": {
"title": "non-physical use of sport-tag",
"description": "This way is tagged {var1} but has no physical tag like e.g. leisure, building, amenity or highway."
"description": "This way is tagged \"sport\"=\"{var1}\" but has no physical tag like e.g. leisure, building, amenity or highway."
},
"_400": {
"title": "geometry glitches",
"description": ""
},
"_401": {
"title": "missing turn restriction",
"description": "ways {var1} and {var2} join in a very sharp angle here and there is no oneway tag or turn restriction that prevents turning from way {var1} to {var2}."
"description": "ways {var1} and {var2} join in a very sharp angle here and there is no oneway tag or turn restriction that prevents turning from way {var3} to {var4}."
},
"_402": {
"title": "impossible angles",
Expand Down Expand Up @@ -1115,15 +1127,15 @@
},
"_60": {
"title": "depreciated tags",
"description": "This {var1} uses deprecated tag {var2}={var3}. Please use {var4} instead!"
"description": "This {var1} uses deprecated tag \"{var2}\"=\"{var3}\". Please use {var4} instead!"
},
"_300": {
"title": "missing maxspeed",
"description": "missing maxspeed tag."
},
"_360": {
"title": "language unknown",
"description": "It would be nice if this {var1} had an additional tag name:XX={var2} where XX shows the language of its name {var2}."
"description": "It would be nice if this {var1} had an additional tag \"name:XX\"=\"{var2}\" where XX shows the language of its name \"{var2}\"."
},
"_390": {
"title": "missing tracktype",
Expand Down
Loading

0 comments on commit ee35037

Please sign in to comment.