Skip to content

Commit

Permalink
fix #24054 - no longer silently ignore identical or mismatching asser…
Browse files Browse the repository at this point in the history
…ts in mapcss tag checker

git-svn-id: https://josm.openstreetmap.de/svn/trunk@19273 0c6e7542-c601-0410-84e7-c038aed88b3b
  • Loading branch information
stoecker committed Dec 30, 2024
1 parent df5e76b commit efbb92a
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 8 deletions.
1 change: 0 additions & 1 deletion resources/data/validator/combinations.mapcss
Original file line number Diff line number Diff line change
Expand Up @@ -1073,7 +1073,6 @@ way[cycleway:both][cycleway:both!=lane][cycleway:both!=separate][/^cycleway(:rig
way[cycleway][cycleway!=lane][cycleway!=separate][/^cycleway(:right|:left|:both|):buffer/] {
throwWarning: tr("{0} together with {1}", "{0.tag}", "{3.tag}");
group: tr("suspicious tag combination");
assertMatch: "way cycleway:right=separate cycleway:right:buffer=yes";
assertMatch: "way cycleway:left=shared_lane cycleway:buffer=no";
assertMatch: "way cycleway:both=track cycleway:left:buffer=yes";
assertMatch: "way cycleway=shared_busway cycleway:buffer=no";
Expand Down
8 changes: 3 additions & 5 deletions resources/data/validator/highway.mapcss
Original file line number Diff line number Diff line change
Expand Up @@ -91,16 +91,14 @@ way[highway=cycleway][bicycle=no],
way[highway=footway][foot=no],
way[highway=cycleway][cycleway=lane] {
throwWarning: tr("{0} together with {1}", "{0.tag}", "{1.tag}");
assertMatch: "way highway=cycleway cycleway=lane";
assertMatch: "way highway=footway maxspeed=20";
assertNoMatch: "way highway=cycleway bicycle=yes";
assertNoMatch: "way highway=cycleway";
assertNoMatch: "way highway=footway foot=yes";
assertNoMatch: "way highway=footway";
assertMatch: "way highway=cycleway cycleway=lane";
assertNoMatch: "way highway=cycleway";
assertNoMatch: "way highway=residential cycleway=lane";
assertMatch: "way highway=footway maxspeed=20";
assertNoMatch: "way highway=residential maxspeed=20";
assertNoMatch: "way highway=footway";
}

/* footway, see #10851, #10976, #15439, #19389, #21235 */
Expand Down Expand Up @@ -214,4 +212,4 @@ relation[highway =~ /^((motorway|trunk|primary|secondary|tertiary)(_link)?|resid
group: tr("questionable value (ending with a number)");
suggestAlternative: "paving_stones:length";
suggestAlternative: "paving_stones:width";
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -150,9 +150,9 @@ static MapCSSTagCheckerRule ofMapCSSRule(final MapCSSRule rule, Consumer<String>
check.deletion = true;
} else if (val != null && "suggestAlternative".equals(ai.key)) {
check.alternatives.add(val);
} else if (val != null && "assertMatch".equals(ai.key)) {
} else if (val != null && "assertMatch".equals(ai.key) && !assertions.containsKey(val)) {
assertions.put(val, Boolean.TRUE);
} else if (val != null && "assertNoMatch".equals(ai.key)) {
} else if (val != null && "assertNoMatch".equals(ai.key) && !assertions.containsKey(val)) {
assertions.put(val, Boolean.FALSE);
} else if (val != null && "group".equals(ai.key)) {
check.group = val;
Expand Down

0 comments on commit efbb92a

Please sign in to comment.