File: check_comments.sh

package info (click to toggle)
libdmtx 0.7.8-1
  • links: PTS
  • area: main
  • in suites: forky, sid
  • size: 2,108 kB
  • sloc: ansic: 10,638; sh: 253; makefile: 154; perl: 28
file content (17 lines) | stat: -rwxr-xr-x 329 bytes parent folder | download | duplicates (10)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
#!/bin/sh

FILE="$1"

LINE=$(grep -n "\*\{10\}" $FILE)
if [[ $? -eq 0 ]]; then
   echo -e "Bad comment style found in $FILE on line(s):\n$LINE"
   exit 1
fi

LINE=$(sed -n -e '1 =' -e '2,$ p' $FILE | grep -n "^\/\*\$")
if [[ $? -eq 0 ]]; then
   echo -e "Bad comment style found in $FILE on line(s):\n$LINE"
   exit 2
fi

exit 0