File: travis-formatting.sh

package info (click to toggle)
aircrack-ng 1%3A1.6%2Bgit20210130.91820bc-1
  • links: PTS, VCS
  • area: main
  • in suites: bullseye
  • size: 19,056 kB
  • sloc: ansic: 67,045; cs: 5,392; sh: 3,773; python: 2,565; pascal: 1,074; asm: 570; makefile: 253; cpp: 46
file content (40 lines) | stat: -rwxr-xr-x 973 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
#!/bin/sh

#
# Bail on OS X for testing this functionality.
#
if [ "x${TRAVIS_OS_NAME:-}" = "xosx" ]; then
    exit 0
fi

#
# Only works with GCC.
#
case "$CC" in
    clang*|llvm*) exit 0;;
esac

# check formatting matches clang-format-3.8. Since newer versions can have
# changes in formatting even without any rule changes, we have to fix on a
# single version.
. ./build/clang_format_all.sh

git clean -f

# Print any diff here, so the error message below is the last thing
git diff

set -e

git diff --quiet || (
  echo "***************************************************";
  echo "*** The code is not clean against clang-format  ***";
  echo "*** Please run clang-format-3.8 and fix the     ***";
  echo "*** differences then rebase/squash them into    ***";
  echo "*** the relevant commits. Do not add a commit   ***";
  echo "*** for just formatting fixes. Thanks!          ***";
  echo "***************************************************";
  exit 1;
  )

exit 0