Page MenuHomePhabricator

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

Authored by epriestley on Jul 27 2018, 6:29 PM.
Tags
None
Referenced Files
F18396780: D19544.diff
Fri, Aug 29, 12:48 PM
F18393866: D19544.id46726.diff
Fri, Aug 29, 9:31 AM
F18393658: D19544.id46725.diff
Fri, Aug 29, 9:20 AM
F18391743: D19544.id46725.diff
Fri, Aug 29, 7:47 AM
F18391061: D19544.id46726.diff
Fri, Aug 29, 7:18 AM
F18390882: D19544.id.diff
Fri, Aug 29, 7:11 AM
F17957574: D19544.id.diff
Fri, Aug 1, 6:24 AM
F17944403: D19544.diff
Thu, Jul 31, 10:00 AM
Subscribers
None

Details

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).

Diff Detail

Repository
rP Phabricator
Branch
json1
Lint
Lint Passed
Unit
Tests Passed
Build Status
Buildable 20522
Build 27871: Run Core Tests
Build 27870: arc lint + arc unit