User:RailML Coord Common/Tools: Difference between revisions

From railML 2 Wiki
Jump to navigation Jump to search
(created page)
 
m (Ferri Leberl moved page User:Thomas Nygreen/Tools to User:RailML Coord Common/Tools: Automatically moved page while renaming the user "Thomas Nygreen" to "RailML Coord Common")
 
(5 intermediate revisions by one other user not shown)
Line 1: Line 1:
Check indentation:
In compliance with [[Dev:Syntactic_Guidelines]]
awk "BEGINFILE {indent=0} /^ *<\/[^>]+>$/ {indent=indent-2} /^ / { here=match($0, /</)-1 ; if (indent != here) print FILENAME, \":\", FNR, \":\", $0} /^ *<[^/!][^>]*[^/]>$/ { indent=here+2 }" *.xsd


Xpath for empty nodes:
== Syntax checks ==
//*[text() and not(normalize-space()) and not(*)]
=== Redundant multiplicities ===
(min|max)Occurs="1"
use="optional"
 
=== Xpath for empty nodes ===
//*[text() and not(normalize-space()) and not(*)]
 
== Content checks ==
 
=== Missing documentation ===
  //xs:element[not(xs:annotation/xs:documentation)]
  //xs:attribute[not(xs:annotation/xs:documentation)]
 
=== Only (wiki) links ===
  //xs:element[not(xs:annotation/xs:documentation[not(starts-with(text(), "See http"))])]
 
=== Missing (wiki) links ===
  //xs:element[not(xs:annotation/xs:documentation[starts-with(text(), "See http")])]
 
== Formatting checks ==
 
=== Find and remove tabulators ===
\t
 
=== Lines not ending with a tag ===
[^>]$
 
=== Lines not starting with a tag ===
^ *[^ <]
 
=== Check indentation ===
awk "BEGINFILE { indent=0 } /^ *<\/[^>]+>$/ { indent=indent-2 } /[^ ]/ { here=match($0, /</)-1 ; if (indent != here) print FILENAME, \":\", FNR, \":\", $0 } /^ *<[^/!?][^>]*[^/]>$/ { indent=here+2 }" *.xsd
 
== SVN ==
 
=== List unmerged revisions in other branches ===
On Windows command line, from directory you want to merge to
FOR /F %B IN ('svn list .. -r HEAD') DO @FOR /F %R IN ('svn mergeinfo --show-revs eligible ..\%B') DO @ECHO %B%R

Latest revision as of 19:46, 15 December 2022

In compliance with Dev:Syntactic_Guidelines

Syntax checks

Redundant multiplicities

(min|max)Occurs="1"
use="optional"

Xpath for empty nodes

//*[text() and not(normalize-space()) and not(*)]

Content checks

Missing documentation

 //xs:element[not(xs:annotation/xs:documentation)]
 //xs:attribute[not(xs:annotation/xs:documentation)]

Only (wiki) links

 //xs:element[not(xs:annotation/xs:documentation[not(starts-with(text(), "See http"))])]

Missing (wiki) links

 //xs:element[not(xs:annotation/xs:documentation[starts-with(text(), "See http")])]

Formatting checks

Find and remove tabulators

\t

Lines not ending with a tag

[^>]$

Lines not starting with a tag

^ *[^ <]

Check indentation

awk "BEGINFILE { indent=0 } /^ *<\/[^>]+>$/ { indent=indent-2 } /[^ ]/ { here=match($0, /</)-1 ; if (indent != here) print FILENAME, \":\", FNR, \":\", $0 } /^ *<[^/!?][^>]*[^/]>$/ { indent=here+2 }" *.xsd

SVN

List unmerged revisions in other branches

On Windows command line, from directory you want to merge to

FOR /F %B IN ('svn list .. -r HEAD') DO @FOR /F %R IN ('svn mergeinfo --show-revs eligible ..\%B') DO @ECHO %B%R