HomePhabricator

Make the "Is this JSON?" DocumentEngine heuristic a little tighter

Description

Make the "Is this JSON?" DocumentEngine heuristic a little tighter

Summary:
See PHI749. Ref T13164. We currently misdetect files starting with [submodule ... as JSON.

Make this a bit stricter:

  • If the file is short, just see if it's actually literally real JSON.
  • If the file is long, give up.

This should get the right result in pretty much all the cases people care about, I think. We could make the long-file guesser better some day.

Test Plan: Detected a [submodule ... file (no longer JSON) and a {"duck": "quack"} file (still JSON).

Reviewers: amckinley

Reviewed By: amckinley

Maniphest Tasks: T13164

Differential Revision: https://secure.phabricator.com/D19544

Details

Provenance
epriestleyAuthored on Jul 27 2018, 6:26 PM
epriestleyPushed on Jul 27 2018, 7:27 PM
Reviewer
amckinley
Differential Revision
D19544: Make the "Is this JSON?" DocumentEngine heuristic a little tighter
Parents
rP727bc2234c3a: Capitalize "OPcache" more consistently
Branches
Unknown
Tags
Unknown
Tasks
T13164: Plans: 2018 Week 31 - 33 Bonus Content
Build Status
Buildable 20523
Build 27872: Run Core Tests