Debian Codegraph @

vendor/wikimedia/parsoid/bin/nodenamecheck.sh

raw symbols SCIP
1 #!/bin/bash
2
3 # Ensure that no more uses of $node -> nodeName creep into our repository...
4 # we should be using DOMCompat::nodeName( $node )
5 # See I7579cbd07df7650f4c7105cc9dbdc87ea294bded
6
7 BIN=$(dirname $0)
8 # put this string together in a somewhat awkward way so that it doesn't
9 # trigger a match itself.
10 grepPhrase="nodeName"
11 grepPhrase=">$grepPhrase"
12 badWords='$node-'"$grepPhrase"
13
14 # If any of these commands fail, something is wrong!
15 set -ev
16
17 # Ensure lint output (exactly 1 line) is present!
18 x=`git grep "$grepPhrase" $BIN/.. | wc -l`
19 if [ ! $x -eq 1 ]
20 then
21 echo "Uses of $badWords found! :("
22 git grep "$grepPhrase" $BIN/..
23 exit -1
24 fi
25 echo "No new uses of $badWords found! :)"