﻿id	summary	reporter	owner	description	type	status	priority	milestone	component	version	resolution	keywords	cc
18765	false positive warning about some direction values	Klumbumbus	Klumbumbus	"from https://github.com/osm-fr/osmose-backend/issues/751

direction=90;270

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:

{{{
#!rule
/* #14989 */
*[direction][direction<0],
*[direction][direction>=360],
*[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 */
}
}}}
"	defect	closed	normal	20.03	Core validator		fixed	direction	
