Index: /trunk/data/validator/combinations.mapcss
===================================================================
--- /trunk/data/validator/combinations.mapcss	(revision 6548)
+++ /trunk/data/validator/combinations.mapcss	(revision 6548)
@@ -0,0 +1,145 @@
+/* Rules partially derived from Taginfo statistics - see ticket #5017
+ * Taginfo query: select keypairs.key1, keypairs.key2, keypairs.count_all, keys.count_all, cast(keypairs.count_all as real)/keys.count_all as from_fraction_all from keys, keypairs where key1='waterway' and keys.key=keypairs.key2 and (key1<>'highway' or keypairs.count_all>12000) and (key1<>'railway' or keypairs.count_all>3000) and (key1<>'waterway' or keypairs.count_all>800) and key2 not like '%:%' and from_fraction_all>0.97 and 1 union select keypairs.key2, keypairs.key1, keypairs.count_all, keys.count_all, cast(keypairs.count_all as real)/keys.count_all as from_fraction_all from keys, keypairs where key2='waterway' and keys.key=keypairs.key1 and (key2<>'highway' or keypairs.count_all>12000) and (key2<>'railway' or keypairs.count_all>3000) and (key2<>'waterway' or keypairs.count_all>800) and key1 not like '%:%' and from_fraction_all>0.97 and 1 order by keypairs.count_all desc limit 1000;
+ */
+
+/* {0.key} without {1.key} */
+way[junction                   ][!highway],
+*[lanes                        ][!highway],
+*[lcn                          ][!highway],
+*[living_street                ][!highway],
+*[maintenance                  ][!highway],
+*[median                       ][!highway],
+*[motorroad                    ][!highway],
+*[ntd_id                       ][!highway],
+*[sac_scale                    ][!highway],
+*[sidewalk                     ][!highway],
+*[smoothness                   ][!highway],
+*[snowplowing                  ][!highway],
+*[step_count                   ][!highway],
+*[tracktype                    ][!highway],
+*[trail_visibility             ][!highway],
+*[trolley_wire                 ][!highway],
+*[zip_left                     ][!highway],
+*[zip_right                    ][!highway],
+*[detail                       ][!railway],
+*[eddy_current_brake           ][!railway],
+*[electrified                  ][!railway],
+*[etcs                         ][!railway],
+*[gauge                        ][!railway],
+*[grade_of_track               ][!railway],
+*[kursbuchstrecke              ][!railway],
+*[lzb                          ][!railway],
+*[old_railway_operator         ][!railway],
+*[operating_procedure          ][!railway],
+*[pzb                          ][!railway],
+*[radio                        ][!railway],
+*[structure_gauge              ][!railway],
+*[tilting_technology           ][!railway],
+*[track_class                  ][!railway],
+*[tracks                       ][!railway],
+*[traffic_mode                 ][!railway],
+*[usage                        ][!railway],
+*[workrules                    ][!railway],
+*[stream                       ][!waterway],
+*[intermittent                 ][!waterway],
+*[length_unit                  ][!waterway],
+*[llid                         ][!waterway],
+*[canal                        ][!waterway],
+*[have_riverbank               ][!waterway],
+*[border_type                  ][!boundary],
+*[source:date                  ][!source],
+*[source:name                  ][!name],
+*[source:maxspeed:forward      ][!maxspeed:forward],
+*[source:maxspeed:backward     ][!maxspeed:backward],
+*[source:maxspeed:forward      ][!source:maxspeed:backward],
+*[source:maxspeed:backward     ][!source:maxspeed:forward],
+*[source:building              ][!building],
+*[source:ref                   ][!ref],
+*[source:population            ][!population],
+*[source:postal_code           ][!postal_code],
+*[source:ele                   ][!ele],
+*[source:ref:INSEE             ][!ref:INSEE],
+*[source:lit                   ][!lit],
+*[source:hgv                   ][!hgv],
+*[source:highway               ][!highway],
+*[source:maxaxleload           ][!maxaxleload],
+*[source:surface               ][!surface],
+*[source:bridge                ][!bridge],
+*[source:old_name              ][!old_name],
+*[source:bicycle               ][!bicycle],
+*[source:designation           ][!designation],
+*[source:height                ][!height],
+*[source:lanes                 ][!lanes],
+*[/source:(addr:)?postcode/    ][!addr:postcode],
+*[/source:(addr:)?housenumber/ ][!addr:housenumber],
+*[source:addr                  ][!/^addr:/],
+*[source:maxspeed              ][!/^maxspeed:?/] {
+  throwWarning: tr("{0} without {1}", "{0.key}", "{1.key}");
+  assertMatch: "way lanes=42";
+  assertNoMatch: "way lanes=42 highway=unclassified";
+  assertMatch: "node source:addr:postcode=postman";
+  assertMatch: "node source:addr=postman";
+  assertNoMatch: "node source:addr=postman addr:housenumber=42";
+}
+
+/* {0.key} without {1.tag} */
+*[fence_type                   ][barrier!=fence],
+*[recycling_type               ][amenity!=recycling],
+*[board_type                   ][information!=board],
+*[shelter_type                 ][amenity!=shelter],
+*[lamp_type                    ][highway!=street_lamp],
+*[map_type                     ][information!=map],
+*[site_type                    ][historic!=archaeological_site],
+*[artwork_type                 ][tourism!=artwork],
+*[castle_type                  ][historic!=castle],
+*[reservoir_type               ][landuse!=reservoir][water!=reservoir],
+*[bunker_type                  ][military!=bunker] {
+  throwWarning: tr("{0} without {1}", "{0.key}", "{1.tag}");
+}
+
+/* {0.key} without {1.key} or {2.key} */
+*[incline                      ][!highway][!railway],
+*[oneway                       ][!highway][!railway] {
+  throwWarning: tr("{0} without {1} or {2}", "{0.key}", "{1.key}", "{2.key}");
+}
+
+/* {0.key} without {1.key} or {2.tag} */
+*[segregated                   ][!highway][railway=crossing],
+*[toll                         ][!highway][route!=ferry],
+*[boat                         ][!waterway][natural!=water][natural != water] {
+  throwWarning: tr("{0} without {1} or {2}", "{0.key}", "{1.key}", "{2.tag}");
+}
+
+/* {0} on a node */
+node[source:geometry],
+node[source:outline] {
+  throwWarning: tr("{0} on a node", "{0.key}");
+}
+
+/* {0} on suspicious object */
+*[tunnel  ][!highway][!railway][!waterway][public_transport != platform][man_made != pipeline],
+*[bridge  ][!highway][!railway][!waterway][!piste:type][public_transport != platform][man_made !~ /^(bridge|pipeline)$/][building != bridge],
+*[psv     ][!highway][!railway][!waterway][amenity !~ /^parking.*/],
+*[width   ][!highway][!railway][!waterway][!aeroway][!cycleway][!footway][!barrier][!man_made][!entrance],
+*[maxspeed][!highway][!railway][traffic_sign !~ /^(.*;)?maxspeed(;.*)?$/][type != enforcement],
+*[lit     ][!highway][!railway][!piste:type][amenity !~ /^parking/][public_transport!=platform][advertising!=billboard][leisure!=pitch] {
+  throwWarning: tr("{0} on suspicious object", "{0.key}");
+}
+
+node[amenity =~ /^(restaurant|cafe|fast_food)$/][!name] {
+  throwOther: tr("restaurant without name");
+  assertMatch: "node amenity=restaurant";
+  assertNoMatch: "node amenity=restaurant name=Foobar";
+}
+
+*[highway][waterway][waterway!=dam],
+*[highway][natural],
+*[landuse][building] {
+  throwWarning: tr("{0} used with {1}", "{0.key}", "{1.key}");
+}
+
+*[natural=water][leisure=swimming_pool],
+*[natural=water][amenity=swimming_pool] {
+  /* see #6932 */
+  throwWarning: tr("natural water used for swimming pool");
+}
Index: /trunk/data/validator/deprecated.mapcss
===================================================================
--- /trunk/data/validator/deprecated.mapcss	(revision 6547)
+++ /trunk/data/validator/deprecated.mapcss	(revision 6548)
@@ -177,16 +177,2 @@
   fixChangeKey: "monitoring:river_level => monitoring:water_level";
 }
-
-*[layer=0] {
-  /* see #9365 - Useless tag layer=0 */
-  throwWarning: tr("{0}={1} is unnecessary", "layer", "0");
-  fixRemove: "layer";
-}
-
-*[emergency=permissive] {
-  /* see #9458 - emergency=permissive makes no sense */
-  throwWarning: tr("{0}={1} makes no sense", "emergency", "permissive");
-  fixAdd: "emergency=yes";
-  assertMatch: "way emergency=permissive";
-  assertNoMatch: "way emergency=designated";
-}
Index: /trunk/data/validator/numeric.mapcss
===================================================================
--- /trunk/data/validator/numeric.mapcss	(revision 6547)
+++ /trunk/data/validator/numeric.mapcss	(revision 6548)
@@ -1,3 +1,9 @@
 /* measurement values and units warnings (ticket #8687) */
+
+*[/^[0-9]+$/] {
+  throwWarning: tr("numerical key");
+  assertMatch: "way 123=foo";
+  assertNoMatch: "way ref.1=foo";
+}
 
 *[layer =~ /\+.*/] {
Index: /trunk/data/validator/power.mapcss
===================================================================
--- /trunk/data/validator/power.mapcss	(revision 6548)
+++ /trunk/data/validator/power.mapcss	(revision 6548)
@@ -0,0 +1,17 @@
+/* power related stuff (incomplete) */
+
+*[power =~ /line|minor_line|cable/][!voltage],
+*[substation][power!=substation],
+*[transformer][!power] {
+  throwWarning: tr("{0} without {1}", "{0.key}", "{1.tag}");
+  assertMatch: "way power=line";
+  assertNoMatch: "way power=line voltage=1";
+}
+
+*[power=substation][!substation],
+*[power=transformer][!transformer] {
+  throwOther: tr("{0} without {1}", "{0.tag}", "{1.key}");
+  assertMatch: "way power=substation";
+  assertMatch: "way power=substation transformer=foobar";
+  assertNoMatch: "way power=substation substation=foobar";
+}
Index: /trunk/data/validator/tagchecker.cfg
===================================================================
--- /trunk/data/validator/tagchecker.cfg	(revision 6547)
+++ /trunk/data/validator/tagchecker.cfg	(revision 6548)
@@ -37,6 +37,4 @@
 # Empty lines and space signs are ignored
 
-*    : W : / *name */i == * && name != *                                       # misspelled key name
-
 # The following could replace unnamed way check. Still at the moment we keep it as it is
 #way  : W : junction == roundabout && highway == /motorway|trunk|primary|secondary|tertiary|residential|pedestrian/ && /name|ref|(name:.*)|(.*_name)|(.*_ref)/ != * # Unnamed junction
@@ -46,137 +44,4 @@
 #way  : W : oneway != BOOLEAN_FALSE && /.*:(backward|forward)/ == *    # oneway combined with *:backward/forward
 
-node : I : amenity == /restaurant|cafe|fast_food/ && name != * # restaurant without name
-#way  : I : highway != * && railway != * && waterway != * && name == * # unusual named way type
-#*    : W : natural == water && waterway == *                   # unusual tag combination (natural=water & waterway)
-*    : W : highway == * && waterway == * && waterway != dam    # unusual tag combination (highway & waterway)
-*    : W : highway == * && natural == *                        # unusual tag combination (highway & natural)
-*    : W : landuse == * && building == *                       # unusual tag combination (landuse & building)
 
-*    : W : highway == proposed && access == *                  # unnecessary access key
-*    : W : highway == /motorway*|trunk*|primary*|secondary*|tertiary*|unclassified|residential|service|living_street/ && motor_vehicle == BOOLEAN_TRUE # unnecessary motor_vehicle=yes
-
-*    : W : natural == water && leisure == swimming_pool        # natural water used for swimming pool
-*    : W : natural == water && amenity == swimming_pool        # natural water used for swimming pool
-
-*    : W : /\d+/ == *                                          # numerical key
-
-# power related stuff (incomplete)
-*    : W : power == /line|minor_line|cable/ && voltage != *    # power line without voltage
-*    : W : substation == * && power != substation              # substation key without power=substation
-*    : W : transformer == * && power != *                      # transformer key without power
-*    : I : power == substation && substation != *              # missing substation=*
-*    : I : power == transformer && transformer != *            # missing transformer=*
-
-
-########################################
-# Rules derived from Taginfo statistics
-########################################
-
-# see ticket #5017
-# Taginfo query: select keypairs.key1, keypairs.key2, keypairs.count_all, keys.count_all, cast(keypairs.count_all as real)/keys.count_all as from_fraction_all from keys, keypairs where key1='waterway' and keys.key=keypairs.key2 and (key1<>'highway' or keypairs.count_all>12000) and (key1<>'railway' or keypairs.count_all>3000) and (key1<>'waterway' or keypairs.count_all>800) and key2 not like '%:%' and from_fraction_all>0.97 and 1 union select keypairs.key2, keypairs.key1, keypairs.count_all, keys.count_all, cast(keypairs.count_all as real)/keys.count_all as from_fraction_all from keys, keypairs where key2='waterway' and keys.key=keypairs.key1 and (key2<>'highway' or keypairs.count_all>12000) and (key2<>'railway' or keypairs.count_all>3000) and (key2<>'waterway' or keypairs.count_all>800) and key1 not like '%:%' and from_fraction_all>0.97 and 1 order by keypairs.count_all desc limit 1000;
-*    : W : incline              == * && highway != * && railway != *                   # incline without highway or railway
-way  : W : junction             == * && highway != *                                   # junction without highway
-*    : W : lanes                == * && highway != *                                   # lanes without highway
-*    : W : lcn                  == * && highway != *                                   # lcn without highway
-*    : W : lit                  == * && highway != * && railway != * && piste:type != * && amenity != /parking.*/ && public_transport != platform && advertising != billboard && leisure != pitch # lit on suspicious object
-*    : W : living_street        == * && highway != *                                   # living_street without highway
-*    : W : maintenance          == * && highway != *                                   # maintenance without highway
-*    : W : median               == * && highway != *                                   # median without highway
-*    : W : motorroad            == * && highway != *                                   # motorroad without highway
-*    : W : ntd_id               == * && highway != *                                   # ntd_id without highway
-*    : W : oneway               == * && highway != * && railway != *                   # oneway without highway or railway
-*    : W : sac_scale            == * && highway != *                                   # sac_scale without highway
-*    : W : segregated           == * && highway != * && railway != crossing            # segregated without highway
-*    : W : sidewalk             == * && highway != *                                   # sidewalk without highway
-*    : W : smoothness           == * && highway != *                                   # smoothness without highway
-*    : W : snowplowing          == * && highway != *                                   # snowplowing without highway
-*    : W : step_count           == * && highway != *                                   # step_count without highway
-*    : W : toll                 == * && highway != * && route != ferry                 # toll without highway
-*    : W : tracktype            == * && highway != *                                   # tracktype without highway
-*    : W : trail_visibility     == * && highway != *                                   # trail_visibility without highway
-*    : W : trolley_wire         == * && highway != *                                   # trolley_wire without highway
-*    : W : zip_left             == * && highway != *                                   # zip_left without highway
-*    : W : zip_right            == * && highway != *                                   # zip_right without highway
-*    : W : detail               == * && railway != *                                   # detail without railway
-*    : W : eddy_current_brake   == * && railway != *                                   # eddy_current_brake without railway
-*    : W : electrified          == * && railway != *                                   # electrified without railway
-*    : W : etcs                 == * && railway != *                                   # etcs without railway
-*    : W : gauge                == * && railway != *                                   # gauge without railway
-*    : W : grade_of_track       == * && railway != *                                   # grade_of_track without railway
-*    : W : kursbuchstrecke      == * && railway != *                                   # kursbuchstrecke without railway
-*    : W : lzb                  == * && railway != *                                   # lzb without railway
-*    : W : old_railway_operator == * && railway != *                                   # old_railway_operator without railway
-*    : W : operating_procedure  == * && railway != *                                   # operating_procedure without railway
-*    : W : pzb                  == * && railway != *                                   # pzb without railway
-*    : W : radio                == * && railway != *                                   # radio without railway
-*    : W : structure_gauge      == * && railway != *                                   # structure_gauge without railway
-*    : W : tilting_technology   == * && railway != *                                   # tilting_technologie without railway
-*    : W : track_class          == * && railway != *                                   # track_class without railway
-*    : W : tracks               == * && railway != *                                   # tracks without railway
-*    : W : traffic_mode         == * && railway != *                                   # traffic_mode without railway
-*    : W : usage                == * && railway != *                                   # usage without railway
-*    : W : workrules            == * && railway != *                                   # workrules without railway
-*    : W : stream               == * && waterway != *                                  # stream without waterway
-*    : W : intermittent         == * && waterway != *                                  # intermittent without waterway
-*    : W : boat                 == * && waterway != * && natural != water              # boat without waterway / natural=water
-*    : W : length_unit          == * && waterway != *                                  # length_unit without waterway
-*    : W : llid                 == * && waterway != *                                  # llid without waterway
-*    : W : canal                == * && waterway != *                                  # canal without waterway
-*    : W : have_riverbank       == * && waterway != *                                  # have_riverbank without waterway
-*    : W : tunnel               == * && highway != * && railway != * && waterway != * && public_transport != platform && man_made != pipeline  # tunnel without highway/railway/waterway/platform/pipeline
-*    : W : bridge               == * && highway != * && railway != * && waterway != * && piste:type != * && public_transport != platform && man_made != /bridge|pipeline/ && building != bridge  # bridge without highway/railway/waterway/platform/piste/pipeline
-*    : W : psv                  == * && highway != * && railway != * && waterway != * && amenity != /parking.*/  # psv without highway/railway/waterway/parking
-*    : W : width                == * && highway != * && railway != * && waterway != * && aeroway != * && cycleway != * && footway != * && barrier != * && man_made != * && entrance != *  # width without physical linear feature
-*    : W : maxspeed             == * && highway != * && railway != * && traffic_sign != /(.*;)?maxspeed(;.*)?/ && type != enforcement  # maxspeed without highway/railway/traffic_sign/enforcement
-*    : W : fence_type           == * && barrier != fence                               # fence_type without barrier=fence
-*    : W : border_type          == * && boundary != *                                  # border_type without boundary
-*    : W : recycling_type       == * && amenity != recycling                           # recycling_type without amenity=recycling
-*    : W : board_type           == * && information != board                           # board_type without information=board
-*    : W : shelter_type         == * && amenity != shelter                             # shelter_type without amenity=shelter
-*    : W : lamp_type            == * && highway != street_lamp                         # lamp_type without highway=street_lamp
-*    : W : map_type             == * && information != map                             # map_type without information=map
-*    : W : site_type            == * && historic != archaeological_site                # site_type without historic=archaeological_site
-*    : W : artwork_type         == * && tourism != artwork                             # artwork_type without tourism=artwork
-*    : W : castle_type          == * && historic != castle                             # castle_type without historic=castle
-*    : W : reservoir_type       == * && landuse != reservoir && water != reservoir     # reservoir_type without landuse/water=reservoir
-*    : W : bunker_type          == * && military != bunker                             # bunker_type without military=bunker
-*    : W : source:addr                  == * && /addr:.*/                != *          # source:addr without addr:*
-*    : W : source:date                  == * && source                   != *          # source:date without source
-*    : W : source:name                  == * && name                     != *          # source:name without name
-*    : W : source:maxspeed              == * && /maxspeed(:.*)?/         != *          # source:maxspeed without maxspeed
-*    : W : source:maxspeed:forward      == * && maxspeed:forward         != *          # source:maxspeed:forward without maxspeed:forward
-*    : W : source:maxspeed:backward     == * && maxspeed:backward        != *          # source:maxspeed:backward without maxspeed:backward
-*    : W : source:maxspeed:forward      == * && source:maxspeed:backward != *          # source:maxspeed:forward without source:maxspeed:backward
-*    : W : source:maxspeed:backward     == * && source:maxspeed:forward  != *          # source:maxspeed:backward without source:maxspeed:forward
-*    : W : source:building              == * && building                 != *          # source:building without building
-*    : W : source:ref                   == * && ref                      != *          # source:ref without ref
-*    : W : source:population            == * && population               != *          # source:population without population
-node : W : source:geometry              == *                                           # source:geometry on a node
-*    : W : /source:(addr:)?postcode/    == * && addr:postcode            != *          # source:[addr:]postcode without addr:postcode
-*    : W : source:postal_code           == * && postal_code              != *          # source:postal_code without postal_code
-*    : W : source:ele                   == * && ele                      != *          # source:ele without ele
-*    : W : source:ref:INSEE             == * && ref:INSEE                != *          # source:ref:INSEE without ref:INSEE
-*    : W : source:lit                   == * && lit                      != *          # source:lit without lit
-*    : W : source:hgv                   == * && hgv                      != *          # source:hgv without hgv
-node : W : source:outline               == *                                           # source:outline on a node
-*    : W : source:highway               == * && highway                  != *          # source:highway without highway
-*    : W : source:maxaxleload           == * && maxaxleload              != *          # source:maxaxleload without maxaxleload
-*    : W : source:surface               == * && surface                  != *          # source:surface without surface
-*    : W : source:bridge                == * && bridge                   != *          # source:bridge without bridge
-*    : W : source:old_name              == * && old_name                 != *          # source:old_name without old_name
-*    : W : source:bicycle               == * && bicycle                  != *          # source:bicycle without bicycle
-*    : W : source:designation           == * && designation              != *          # source:designation without designation
-*    : W : /source:(addr:)?housenumber/ == * && addr:housenumber         != *          # source:[addr:]housenumber without addr:housenumber
-*    : W : source:height                == * && height                   != *          # source:height without height
-*    : W : source:lanes                 == * && lanes                    != *          # source:lanes without lanes
-
-
-#####################################
-# validation for the wikipedia=* tag
-#####################################
-
-# see ticket #8383
-# If there is no language at all, this is broken. Also catches 'wikipedia' used as 'email', 'website', 'ele' [sic!] ...
-* : E : wikipedia == * && wikipedia != /[a-zA-Z_-]{2,12}:.*/ # no wikipedia-language given, use ''wikipedia''=''language:page title''
-# Valid languages are extracted from <http://de.wikipedia.org/w/api.php?action=sitematrix&format=xml>, which may change, so this is a warning only.
-* : W : wikipedia == /[a-zA-Z_-]{2,12}:.*/ && wikipedia != /(aa|ab|ace|af|ak|als|am|an|ang|ar|arc|arz|as|ast|av|ay|az|ba|bar|bat-smg|bcl|be|be-x-old|bg|bh|bi|bjn|bm|bn|bo|bpy|br|bs|bug|bxr|ca|cbk-zam|cdo|ce|ceb|ch|cho|chr|chy|ckb|co|cr|crh|cs|csb|cu|cv|cy|cz|da|de|diq|dk|dsb|dv|dz|ee|el|eml|en|eo|epo|es|et|eu|ext|fa|ff|fi|fiu-vro|fj|fo|fr|frp|frr|fur|fy|ga|gag|gan|gd|gl|glk|gn|got|gu|gv|ha|hak|haw|he|hi|hif|ho|hr|hsb|ht|hu|hy|hz|ia|id|ie|ig|ii|ik|ilo|io|is|it|iu|ja|jbo|jp|jv|ka|kaa|kab|kbd|kg|ki|kj|kk|kl|km|kn|ko|koi|kr|krc|ks|ksh|ku|kv|kw|ky|la|lad|lb|lbe|lez|lg|li|lij|lmo|ln|lo|lt|ltg|lv|map-bms|mdf|mg|mh|mhr|mi|minnan|mk|ml|mn|mo|mr|mrj|ms|mt|mus|mwl|my|myv|mzn|na|nah|nan|nap|nb|nds|nds-nl|ne|new|ng|nl|nn|no|nov|nrm|nso|nv|ny|oc|om|or|os|pa|pag|pam|pap|pcd|pdc|pfl|pi|pih|pl|pms|pnb|pnt|ps|pt|qu|rm|rmy|rn|ro|roa-rup|roa-tara|ru|rue|rw|sa|sah|sc|scn|sco|sd|se|sg|sh|si|simple|sk|sl|sm|sn|so|sq|sr|srn|ss|st|stq|su|sv|sw|szl|ta|te|tet|tg|th|ti|tk|tl|tn|to|tpi|tr|ts|tt|tum|tw|ty|udm|ug|uk|ur|uz|ve|vec|vep|vi|vls|vo|wa|war|wo|wuu|xal|xh|xmf|yi|yo|za|zea|zh|zh-cfr|zh-classical|zh-min-nan|zh-yue|zu):.*/  # unknown language prefix in wikipedia tag
+# all former checks are now located in data/validator/*mapcss :-)
Index: /trunk/data/validator/unnecessary.mapcss
===================================================================
--- /trunk/data/validator/unnecessary.mapcss	(revision 6548)
+++ /trunk/data/validator/unnecessary.mapcss	(revision 6548)
@@ -0,0 +1,17 @@
+*[access][highway=proposed],
+*[motor_vehicle?][highway =~ /motorway|trunk|primary|secondary|tertiary|unclassified|residential|service|living_street/],
+*[layer="0"] {
+  /* see #9365 - Useless tag layer=0 */
+  throwWarning: tr("{0} is unnecessary", "{0.tag}");
+  fixRemove: "{0.key}";
+  assertMatch: "way layer=0";
+  assertMatch: "way highway=proposed access=no";
+}
+
+*[emergency=permissive] {
+  /* see #9458 - emergency=permissive makes no sense */
+  throwWarning: tr("{0}={1} makes no sense", "emergency", "permissive");
+  fixAdd: "emergency=yes";
+  assertMatch: "way emergency=permissive";
+  assertNoMatch: "way emergency=designated";
+}
Index: /trunk/data/validator/wikipedia.mapcss
===================================================================
--- /trunk/data/validator/wikipedia.mapcss	(revision 6548)
+++ /trunk/data/validator/wikipedia.mapcss	(revision 6548)
@@ -0,0 +1,16 @@
+/* validation for the wikipedia=* tag - see ticket #8383 */
+
+/* If there is no language at all, this is broken. Also catches 'wikipedia' used as 'email', 'website', 'ele' [sic!] ... */
+*[wikipedia][wikipedia !~ /^[a-zA-Z_-]{2,12}:/] {
+  throwError: tr("no wikipedia-language given, use ''wikipedia''=''language:page title''");
+  assertMatch: "node wikipedia=Foobar";
+  assertNoMatch: "node wikipedia=en:Foobar";
+  assertNoMatch: "node wikipedia=en-GB:Foobar";
+}
+
+/* Valid languages are extracted from <http://de.wikipedia.org/w/api.php?action=sitematrix&format=xml>, which may change, so this is a warning only. */
+*[wikipedia =~ /^[a-zA-Z_-]{2,12}:/][wikipedia !~ /^(aa|ab|ace|af|ak|als|am|an|ang|ar|arc|arz|as|ast|av|ay|az|ba|bar|bat-smg|bcl|be|be-x-old|bg|bh|bi|bjn|bm|bn|bo|bpy|br|bs|bug|bxr|ca|cbk-zam|cdo|ce|ceb|ch|cho|chr|chy|ckb|co|cr|crh|cs|csb|cu|cv|cy|cz|da|de|diq|dk|dsb|dv|dz|ee|el|eml|en|eo|epo|es|et|eu|ext|fa|ff|fi|fiu-vro|fj|fo|fr|frp|frr|fur|fy|ga|gag|gan|gd|gl|glk|gn|got|gu|gv|ha|hak|haw|he|hi|hif|ho|hr|hsb|ht|hu|hy|hz|ia|id|ie|ig|ii|ik|ilo|io|is|it|iu|ja|jbo|jp|jv|ka|kaa|kab|kbd|kg|ki|kj|kk|kl|km|kn|ko|koi|kr|krc|ks|ksh|ku|kv|kw|ky|la|lad|lb|lbe|lez|lg|li|lij|lmo|ln|lo|lt|ltg|lv|map-bms|mdf|mg|mh|mhr|mi|minnan|mk|ml|mn|mo|mr|mrj|ms|mt|mus|mwl|my|myv|mzn|na|nah|nan|nap|nb|nds|nds-nl|ne|new|ng|nl|nn|no|nov|nrm|nso|nv|ny|oc|om|or|os|pa|pag|pam|pap|pcd|pdc|pfl|pi|pih|pl|pms|pnb|pnt|ps|pt|qu|rm|rmy|rn|ro|roa-rup|roa-tara|ru|rue|rw|sa|sah|sc|scn|sco|sd|se|sg|sh|si|simple|sk|sl|sm|sn|so|sq|sr|srn|ss|st|stq|su|sv|sw|szl|ta|te|tet|tg|th|ti|tk|tl|tn|to|tpi|tr|ts|tt|tum|tw|ty|udm|ug|uk|ur|uz|ve|vec|vep|vi|vls|vo|wa|war|wo|wuu|xal|xh|xmf|yi|yo|za|zea|zh|zh-cfr|zh-classical|zh-min-nan|zh-yue|zu):/] {
+  throwWarning: tr("unknown language prefix in wikipedia tag");
+  assertMatch: "node wikipedia=X-Y-Z:Foobar";
+  assertNoMatch: "node wikipedia=en:Foobar";
+}
Index: /trunk/src/org/openstreetmap/josm/data/validation/tests/MapCSSTagChecker.java
===================================================================
--- /trunk/src/org/openstreetmap/josm/data/validation/tests/MapCSSTagChecker.java	(revision 6547)
+++ /trunk/src/org/openstreetmap/josm/data/validation/tests/MapCSSTagChecker.java	(revision 6548)
@@ -255,5 +255,5 @@
                 cmds.add(new ChangePropertyKeyCommand(p, oldKey, newKey));
             }
-            return new SequenceCommand(tr("Fix of {0}", getDescription()), cmds);
+            return new SequenceCommand(tr("Fix of {0}", getDescriptionForMatchingSelector(matchingSelector)), cmds);
         }
 
@@ -271,4 +271,5 @@
          *
          * @return a description (possibly with alternative suggestions)
+         * @see {@link #getDescriptionForMatchingSelector(Selector)}
          */
         String getDescription() {
@@ -281,6 +282,21 @@
         }
 
+        /**
+         * Constructs a (localized) description for this deprecation check
+         * where any placeholders are replaced by values of the matched selector.
+         *
+         * @return a description (possibly with alternative suggestions)
+         */
+        String getDescriptionForMatchingSelector(Selector matchingSelector) {
+            return insertArguments(matchingSelector, getDescription());
+        }
+
         Severity getSeverity() {
             return errors.values().iterator().next();
+        }
+
+        @Override
+        public String toString() {
+            return getDescription();
         }
 
@@ -295,5 +311,5 @@
             if (matchingSelector != null) {
                 final Command fix = fixPrimitive(p);
-                final String description = TagCheck.insertArguments(matchingSelector, getDescription());
+                final String description = getDescriptionForMatchingSelector(matchingSelector);
                 if (fix != null) {
                     return new FixableTestError(null, getSeverity(), description, 3000, p, fix);
@@ -363,4 +379,8 @@
         addMapCSS("religion.mapcss");
         addMapCSS("relation.mapcss");
+        addMapCSS("combinations.mapcss");
+        addMapCSS("unnecessary.mapcss");
+        addMapCSS("wikipedia.mapcss");
+        addMapCSS("power.mapcss");
     }
 }
Index: /trunk/test/unit/org/openstreetmap/josm/data/validation/tests/MapCSSTagCheckerTest.java
===================================================================
--- /trunk/test/unit/org/openstreetmap/josm/data/validation/tests/MapCSSTagCheckerTest.java	(revision 6547)
+++ /trunk/test/unit/org/openstreetmap/josm/data/validation/tests/MapCSSTagCheckerTest.java	(revision 6548)
@@ -55,4 +55,5 @@
         assertThat(check.getErrorForPrimitive(n1).getMessage(), is("natural=marsh is deprecated"));
         assertThat(check.getErrorForPrimitive(n1).getSeverity(), is(Severity.WARNING));
+        assertThat(check.fixPrimitive(n1).getDescriptionText(), is("Sequence: Fix of natural=marsh is deprecated"));
         assertThat(((ChangePropertyCommand) check.fixPrimitive(n1).getChildren().iterator().next()).getTags().toString(),
                 is("{natural=}"));
@@ -76,5 +77,5 @@
             throw new IllegalArgumentException("Expecting n/node/w/way/r/relation, but got " + x[0]);
         }
-        for (final Map.Entry<String, String> i : TextTagParser.getValidatedTagsFromText(x[1]).entrySet()) {
+        for (final Map.Entry<String, String> i : TextTagParser.readTagsFromText(x[1]).entrySet()) {
             p.put(i.getKey(), i.getValue());
         }
