Changeset 17266 in josm


Ignore:
Timestamp:
2020-10-26T15:56:55+01:00 (4 years ago)
Author:
Klumbumbus
Message:

fix #19907 - Adjust some numeric regular expessions to warn about cases with missing numbers after decimal separator (width=10'2." or maxheight=2. m), don't warn about values without inch (feet only)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/resources/data/validator/numeric.mapcss

    r17145 r17266  
    218218}
    219219
    220 *[height      ][height !~ /^(([0-9]+\.?[0-9]*( (m|ft))?)|([1-9][0-9]*\'((10|11|[0-9])((\.[0-9]+)?)\")?))$/]!.height_separator_autofix!.height_meter_autofix!.height_foot_autofix,
     220*[height      ][height !~ /^(([0-9]+(\.[0-9]+)?( (m|ft))?)|([1-9][0-9]*\'((10|11|[0-9])((\.[0-9]+)?)\")?))$/]!.height_separator_autofix!.height_meter_autofix!.height_foot_autofix,
    221221*[maxheight][maxheight !~ /^(([1-9][0-9]*(\.[0-9]+)?( (m|ft))?)|([0-9]+\'(([0-9]|10|11)(\.[0-9]*)?\")?)|none|default|below_default)$/]!.maxheight_separator_autofix!.maxheight_meter_autofix!.maxheight_foot_autofix,
    222222*[maxlength][maxlength !~ /^(([1-9][0-9]*(\.[0-9]+)?( (m|ft))?)|([0-9]+\'(([0-9]|10|11)(\.[0-9]*)?\")?)|none|default|below_default)$/]!.maxlength_separator_autofix!.maxlength_meter_autofix!.maxlength_foot_autofix,
    223 *[width        ][width !~ /^(([0-9]+\.?[0-9]*( (m|ft))?)|([0-9]+\'([0-9]+\.?[0-9]*\")?))$/]!.width_separator_autofix!.width_meter_autofix!.width_foot_autofix,
    224 *[maxwidth  ][maxwidth !~ /^(([0-9]+\.?[0-9]*( (m|ft))?)|([0-9]+\'[0-9]+\.?[0-9]*\"))$/]!.maxwidth_separator_autofix!.maxwidth_meter_autofix!.maxwidth_foot_autofix {
     223*[width        ][width !~ /^(([0-9]+(\.[0-9]+)?( (m|ft))?)|([0-9]+\'([0-9]+(\.[0-9]+)?\")?))$/]!.width_separator_autofix!.width_meter_autofix!.width_foot_autofix,
     224*[maxwidth  ][maxwidth !~ /^(([0-9]+(\.[0-9]+)?( (m|ft))?)|([0-9]+\'([0-9]+(\.[0-9]+)?\")?))$/]!.maxwidth_separator_autofix!.maxwidth_meter_autofix!.maxwidth_foot_autofix {
    225225  throwWarning: tr("unusual value of {0}: meters is default; point is decimal separator; if units, put space then unit", "{0.key}");
    226226  assertMatch: "node height=medium";
     
    228228  assertMatch: "node maxlength=0";
    229229  assertMatch: "node maxlength=10'13\"";
     230  assertMatch: "node width=10'2.\"";
     231  assertMatch: "node maxheight=\"2. m\"";
     232  assertMatch: "node height=\"12. m\"";
    230233  assertNoMatch: "node height=6.78 meters";
    231234  assertNoMatch: "node height=5  metre";
     
    237240  assertNoMatch: "node height=22'";
    238241  assertNoMatch: "node width=10'5\"";
     242  assertNoMatch: "node width=10'";
    239243}
    240244
     
    263267}
    264268
    265 *[maxaxleload][maxaxleload !~ /^(([0-9]+\.?[0-9]*( (t|kg|st|lbs))?)|([0-9]+\'[0-9]+\.?[0-9]*\"))$/]!.maxaxleload_separator_autofix,
    266 *[maxweight][maxweight !~ /^(([0-9]+\.?[0-9]*( (t|kg|st|lbs))?)|([0-9]+\'[0-9]+\.?[0-9]*\"))$/]!.maxweight_separator_autofix {
     269*[maxaxleload][maxaxleload !~ /^(([0-9]+(\.[0-9]+)?( (t|kg|st|lbs))?)|([0-9]+\'([0-9]+(\.[0-9]+)?\")?))$/]!.maxaxleload_separator_autofix,
     270*[maxweight][maxweight !~ /^(([0-9]+(\.[0-9]+)?( (t|kg|st|lbs))?)|([0-9]+\'([0-9]+(\.[0-9]+)?\")?))$/]!.maxweight_separator_autofix {
    267271  throwWarning: tr("unusual value of {0}: tonne is default; point is decimal separator; if units, put space then unit", "{0.key}");
    268272  assertMatch: "node maxaxleload=something";
    269273  assertMatch: "node maxweight=-5";
    270274  assertNoMatch: "node maxaxleload=2";
     275  assertNoMatch: "node maxweight=12'";
    271276  assertNoMatch: "node maxweight=6'6\"";
    272277  assertNoMatch: "node maxaxleload=2.5";
     
    303308  assertNoMatch: "node distance=4";
    304309}
    305 *[distance][distance !~ /^(([0-9]+\.?[0-9]*( (m|km|mi|nmi))?)|([0-9]+\'[0-9]+\.?[0-9]*\"))$/]!.distance_separator_autofix {
     310*[distance][distance !~ /^(([0-9]+(\.[0-9]+)?( (m|km|mi|nmi))?)|([0-9]+\'[0-9]+\.?[0-9]*\"))$/]!.distance_separator_autofix {
    306311  throwWarning: tr("unusual value of {0}: kilometers is default; point is decimal separator; if units, put space then unit", "{0.key}");
    307312  assertMatch: "way distance=something";
    308313  assertMatch: "way distance=-5";
     314  assertMatch: "way distance=5.";
    309315  assertNoMatch: "way distance=2";
    310316  assertNoMatch: "way distance=2.5";
Note: See TracChangeset for help on using the changeset viewer.