dib-lint: match text/x-script.python

It seems libmagic changed it's Python output to
"text/x-script.python", which I see on Fedora.  Handle this too so we
detect Python files correctly.

[1] eb373e431c

Change-Id: I35992c70523a8f2bc5efff2e5167ed1ac1514d34
changes/69/790369/1
Ian Wienand 2 years ago
parent b536dbba8e
commit eed1be9992

@ -111,7 +111,7 @@ for i in $(find $ELEMENTS_DIR -type f \
# "dib-python" interpreter can confuse the magic matching
# being done in "file" and make it think the file is not
# python; special-case it.
if [[ "$(file -b -k --mime-type $i)" =~ "text/x-python" ]] || \
if [[ "$(file -b -k --mime-type $i)" =~ (text/x-python|text/x-script.python) ]] || \
[[ $firstline =~ "dib-python" ]]; then
flake8 $i || error "$i failed flake8"
else

Loading…
Cancel
Save