summaryrefslogtreecommitdiff
path: root/util/lint/lint-stable-023-filenames
blob: a70f988957800b803b7eb85fe9bb55a92b1fa751 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
#!/bin/sh
#
# SPDX-License-Identifier: GPL-2.0-only

# DESCR: Check for illegal characters in filename

LC_ALL=C export LC_ALL

# Skip check if git isn't available
if [ -n "$(command -v git)" ] && \
	[ "$(git rev-parse --is-inside-work-tree 2>/dev/null)" = "true" ]
then
	git ls-files | grep "[^A-Za-z0-9/_\.-]"
fi