From 716be1d6f0d8fe26c0a1b294cdb8228596e4aedc Mon Sep 17 00:00:00 2001 From: Darragh Bailey Date: Wed, 25 May 2016 16:49:59 +0100 Subject: [PATCH] Handle file magic type varying order matching Allow file test to return all possible mime-types and ensure anything that matches the python file type is parsed by flake8 instead of relying on the first match returned. Closes-Bug: #1585688 Change-Id: Iba31f1853537fe9234ab6f83d66f13dc1c578abb --- bin/dib-lint | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bin/dib-lint b/bin/dib-lint index 24877849..2a797958 100755 --- a/bin/dib-lint +++ b/bin/dib-lint @@ -80,7 +80,7 @@ for i in $(find elements -type f \ fi # Ensure 4 spaces indent are used - if [ "$(file -b --mime-type $i)" = "text/x-python" ]; then + if [[ "$(file -b -k --mime-type $i)" =~ "text/x-python" ]]; then flake8 $i || error "$i failed flake8" else if ! excluded indent ; then