Opened 3 months ago

Closed 3 months ago

Last modified 3 months ago

#18765 closed defect (fixed)

false positive warning about some direction values

Reported by: Klumbumbus Owned by: Klumbumbus
Priority: normal Milestone: 20.03
Component: Core validator Version:
Keywords: direction Cc:




The regexp needs to be improved, it doesn't support two single values. Also ranges combined with single values are not supported. These are right now explicit marked as assertMatch: "node direction=45-100;190-250;300"; because when I created that regexp I thought about an incomplete range. However thinking about it again as single values and ranges are supported also a combination of both should be supported.

current code:

/* #14989 */
*[direction][direction !~ /^([0-9][0-9]?[0-9]?|north|east|south|west|N|E|S|W|NE|SE|SW|NW|NNE|ENE|ESE|SSE|SSW|WSW|WNW|NNW|forward|backward|both|clockwise|anti-clockwise|anticlockwise|up|down)(-([0-9][0-9]?[0-9]?|N|E|S|W|NE|SE|SW|NW|NNE|ENE|ESE|SSE|SSW|WSW|WNW|NNW))?(;([0-9][0-9]?[0-9]?|N|E|S|W|NE|SE|SW|NW|NNE|ENE|ESE|SSE|SSW|WSW|WNW|NNW)-([0-9][0-9]?[0-9]?|N|E|S|W|NE|SE|SW|NW|NNE|ENE|ESE|SSE|SSW|WSW|WNW|NNW))*$/] {
  throwWarning: tr("unusual value of {0}", "{0.key}");
  assertMatch: "node direction=north-down";
  assertMatch: "node direction=rome";
  assertMatch: "node direction=C";
  assertMatch: "node direction=NNNE";
  assertMatch: "node direction=1360";
  assertNoMatch: "node direction=NE-S"; /* ranges are used at tourism=viewpoint*/
  assertMatch: "node direction=north-south"; /* ranges only in numbers or short NESW form */
  assertMatch: "node direction=north-east"; /* if range use N-E, if single direcion use NE */
  assertNoMatch: "node direction=0-360"; /* complete panorama view */
  assertNoMatch: "node direction=45-100;190-250;300-360";
  assertMatch: "node direction=45-100;190-250;300";
  assertNoMatch: "node direction=up"; 
  assertNoMatch: "node direction=down"; /* up/down are replaced by incline tag, has separate warning */
  assertMatch: "node direction=-10";
  assertNoMatch: "node direction=0";
  assertNoMatch: "node direction=45";
  assertMatch: "node direction=360";
  assertNoMatch: "node direction=N";
  assertNoMatch: "node direction=NNE";
  assertNoMatch: "node direction=west";
  assertNoMatch: "node direction=forward";
  assertNoMatch: "node direction=anti-clockwise";
  assertNoMatch: "node direction=anticlockwise"; /* both spellings are in use and even wiki uses both */

Attachments (0)

Change History (3)

comment:1 Changed 3 months ago by Don-vip

Keywords: direction added

comment:2 Changed 3 months ago by Klumbumbus

Resolution: fixed
Status: assignedclosed

In 15965/josm:

fix #18765 - Don't warn about two single values of direction (direction=90;270) and combination of ranges and single values (direction=45-100;190-250;300)

comment:3 Changed 3 months ago by Klumbumbus

Milestone: 20.03

Modify Ticket

Change Properties
Set your email in Preferences
as closed The owner will remain Klumbumbus.
as The resolution will be set.
The resolution will be deleted.

Add Comment

E-mail address and name can be saved in the Preferences.

Note: See TracTickets for help on using tickets.