File: python-black-check.sh

package info (click to toggle)
piper 0.8-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 2,460 kB
  • sloc: python: 2,734; sh: 85; makefile: 5
file content (21 lines) | stat: -rwxr-xr-x 421 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
#!/bin/sh

if [ -z "$MESON_SOURCE_ROOT" ]; then
	echo >&2 "Expected \$MESON_SOURCE_ROOT to be set. Are you sure you are running this through ninja?"
	exit 100
fi

cd "$MESON_SOURCE_ROOT" || exit 101

files=$(git ls-files "*.py" "*.py.in")
if [ -z "$files" ]; then
	echo >&2 "Git didn't find any files"
	exit 77
fi

command -v black >/dev/null 2>&1 || {
	echo >&2 "black is not installed"
	exit 77
}

black --check $files