Debian Codegraph @

.gitlab-ci/check-meson

raw symbols SCIP
1 #!/bin/bashscip-shell filesystem . . `/bin/bash`.
2 #
3 # Copyright (C) 2025 The Phosh developers
4 #
5 # SPDX-License-Identifier: GPL-3.0-or-later
6 #
7 # Author: Guido Günther <[email protected]>
8
9 ret=0
10
11 TMPDIR=$(mktempscip-shell system . . mktemp. -d)
12
13 # We check files individually so we can print the diff:
14 while IFS= read -r -d '' file; do
15 if ! mesonscip-shell system . . meson. format -e --check-only "$file"; then
16 echoscip-shell system . . echo.
17 echoscip-shell system . . echo. "Meson file '${file}' needs reformat:"
18 mesonscip-shell system . . meson. format -e "$file" > "${TMPDIR}/meson.build"
19 diffscip-shell system . . diff. -u "$file" "${TMPDIR}/meson.build"
20 rmscip-shell system . . rm. -f "${TMPDIR}/meson.build"
21 ret=1
22 fi
23 done < <(findscip-shell system . . find. . -name '*.build' -not -path './subprojects/*' -print0)
24
25 if [scip-shell system . . `[`. -n "$TMPDIR" ]; then
26 rmdirscip-shell system . . rmdir. "${TMPDIR}"
27 fi
28
29 if [scip-shell system . . `[`. $ret -ne 0 ]; then
30 catscip-shell system . . cat. <<EOF
31
32 To reformat all files run:
33
34 meson format -e --recursive --inplace
35
36 EOF
37 fi
38
39 exit $ret