File: check_format.sh

package info (click to toggle)
dart 6.12.1%2Bdfsg4-12
  • links: PTS, VCS
  • area: main
  • in suites: bookworm
  • size: 57,000 kB
  • sloc: cpp: 269,461; python: 3,911; xml: 1,273; sh: 404; makefile: 30
file content (15 lines) | stat: -rwxr-xr-x 361 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
#!/bin/bash
if [ "$#" -lt 2 ]; then
  echo "Usage: ./check_format.sh [<file> ...]" >&2
  exit 0
fi

num_changes=`$1 -style=file -output-replacements-xml "${@:2}" | grep -c "<replacement "`

if [ "$num_changes" = "0" ]; then
  echo "Every file seems to comply with our code convention."
  exit 0
else
  echo "Found" $num_changes "necessary changes."
  exit 0
fi