[diffoscope] 01/04: Reflow conditional for next commit.
Chris Lamb
chris at chris-lamb.co.uk
Wed Jan 24 03:45:02 CET 2018
This is an automated email from the git hooks/post-receive script.
lamby pushed a commit to branch master
in repository diffoscope.
commit 0376170fa4e434cffcc0abb3f837d408d6f4e15c
Author: Chris Lamb <lamby at debian.org>
Date: Wed Jan 24 13:39:38 2018 +1100
Reflow conditional for next commit.
Gbp-Dch: ignore
---
diffoscope/comparators/json.py | 7 +++++--
1 file changed, 5 insertions(+), 2 deletions(-)
diff --git a/diffoscope/comparators/json.py b/diffoscope/comparators/json.py
index 7263657..3221597 100644
--- a/diffoscope/comparators/json.py
+++ b/diffoscope/comparators/json.py
@@ -30,8 +30,11 @@ class JSONFile(File):
def recognizes(cls, file):
with open(file.path) as f:
# Try fuzzy matching for JSON files
- if not file.name.endswith('.json') and \
- file.magic_file_type.startswith('ASCII text'):
+ is_text = any(
+ file.magic_file_type.startswith(x)
+ for x in ('ASCII text'),
+ )
+ if is_text and not file.name.endswith('.json'):
if '{' not in f.read(10):
return False
f.seek(0)
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/reproducible/diffoscope.git
More information about the diffoscope
mailing list