summaryrefslogtreecommitdiff
path: root/util/lint/lint-stable-004-style-labels
blob: dbb10acd288297449b666c34c96c2294b45f19d9 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
#!/usr/bin/env sh
#
# SPDX-License-Identifier: GPL-2.0-only

# DESCR: Check that C labels begin at start-of-line

LINTDIR="$(
  cd -- "$(dirname "$0")" > /dev/null 2>&1 || return
  pwd -P
)"

# shellcheck source=helper_functions.sh
. "${LINTDIR}/helper_functions.sh"

${FIND_FILES} | \
	grep "^src/.*\.[csS]$" | \
	grep -v "^src/vendorcode/wuffs/" | \
	xargs grep -Hn '^[[:space:]][[:space:]]*[a-z][a-z]*:[[:space:]]*$' | \
	grep -v "[^a-z_]default:"