File: update-perlcritic

package info (click to toggle)
adequate 0.15.2
  • links: PTS, VCS
  • area: main
  • in suites: buster
  • size: 344 kB
  • sloc: perl: 1,127; python: 351; makefile: 140; sh: 89; ansic: 29
file content (22 lines) | stat: -rwxr-xr-x 426 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
#!/bin/sh
set -e -u
here=$(basename "$0")
cd "$here/.."
target=doc/todo.perlcritic
if perlcritic --verbose '%p\n' adequate > "${target}.tmp"
then
    :
else
    rc=$?
    if [ $rc -ne 2 ]
    then
        rm -f "${target}.tmp"
        exit $rc
    fi
fi
sort "${target}.tmp" | uniq -c > "${target}.new"
rm -f "${target}.tmp"
diff -u "${target}" "${target}.new" || true
mv "${target}.new" "${target}"

# vim:ts=4 sts=4 sw=4 et