Commit 2a758d3d authored by Chris Lamb's avatar Chris Lamb 💬

Do some cheap fuzzy parsing to detect JSON files not named .json. (re. #888112)

parent 9bcbb517
......@@ -26,14 +26,16 @@ from .utils.file import File
class JSONFile(File):
def recognizes(cls, file):
if not super().recognizes(file):
return False
with open(file.path) as f:
# Try fuzzy matching for JSON files
if not'.json') and \
file.magic_file_type.startswith('ASCII text'):
if '{' not in
return False
file.parsed = json.load(
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment