From eed1be9992bbc385f1bac1e3b10d58655065ec3a Mon Sep 17 00:00:00 2001 From: Ian Wienand Date: Mon, 10 May 2021 14:29:51 +1000 Subject: [PATCH] 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] https://github.com/file/file/commit/eb373e431ccfeedfbcf497e4da07571d43bdb9f2 Change-Id: I35992c70523a8f2bc5efff2e5167ed1ac1514d34 --- bin/dib-lint | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bin/dib-lint b/bin/dib-lint index 5cdeb0c2..11e5c14f 100755 --- a/bin/dib-lint +++ b/bin/dib-lint @@ -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