Page MenuHomePhabricator

Better handling of `.arcconfig` files.
ClosedPublic

Authored by joshuaspence on Jun 23 2014, 4:05 AM.
Tags
None
Referenced Files
F13157722: D9681.diff
Sun, May 5, 1:49 PM
F13150287: D9681.diff
Sat, May 4, 2:52 PM
Unknown Object (File)
Fri, May 3, 4:03 AM
Unknown Object (File)
Mon, Apr 29, 3:33 PM
Unknown Object (File)
Mon, Apr 29, 2:48 AM
Unknown Object (File)
Fri, Apr 26, 3:24 PM
Unknown Object (File)
Thu, Apr 25, 5:31 PM
Unknown Object (File)
Thu, Apr 25, 5:31 PM

Details

Summary

Throw a useful error message when an .arcconfig file is not valid JSON.

Depends on D9697.

Test Plan

Modified an .arcconfig file to be invalid JSON.

> arc lint
Usage Exception: Your '~/.arcrc' file is not a valid JSON file.

Parse error on line 18 at column 4: Expected: 'STRING' - It appears you have an extra trailing comma

Diff Detail

Repository
rARC Arcanist
Branch
arcconfig-error
Lint
Lint Passed
Unit
Tests Passed
Build Status
Buildable 1319
Build 1319: [Placeholder Plan] Wait for 30 Seconds

Event Timeline

joshuaspence retitled this revision from to Better handling of `.arcconfig` files..
joshuaspence updated this object.
joshuaspence edited the test plan for this revision. (Show Details)
joshuaspence added a reviewer: epriestley.
epriestley edited edge metadata.

Maybe worth considering PhutilProxyException or introducing some UsageProxyException. Not sure how nasty the PhutilProxyException output is.

This revision is now accepted and ready to land.Jun 23 2014, 2:12 PM
joshuaspence edited edge metadata.
  • Use a PhutilProxyException
joshuaspence updated this object.
joshuaspence edited edge metadata.

Please confirm that you are okay with the use of PhutilProxyException.

epriestley edited edge metadata.
This revision is now accepted and ready to land.Jun 23 2014, 11:22 PM

Since updating to this revision, I get this error:

$ arc linters
Exception
Failed to parse '.../site/.git/arc/config' as JSON.
Parse error on line 1 at column 0: Expected one of: 'STRING', 'NUMBER', 'NULL', 'TRUE', 'FALSE', '{', '['
(Run with --trace for a full exception trace.)

And that's because:

$ cat .git/arc/config
{}

Should an empty .git/arc/config really be an error? I think arc made that itself at some point.

In D9681#22, @turadg wrote:

Since updating to this revision, I get this error:

$ arc linters
Exception
Failed to parse '.../site/.git/arc/config' as JSON.
Parse error on line 1 at column 0: Expected one of: 'STRING', 'NUMBER', 'NULL', 'TRUE', 'FALSE', '{', '['
(Run with --trace for a full exception trace.)

And that's because:

$ cat .git/arc/config
{}

Should an empty .git/arc/config really be an error? I think arc made that itself at some point.

No, this doesn't seem right. Let me take a look.

In D9681#22, @turadg wrote:

Since updating to this revision, I get this error:

$ arc linters
Exception
Failed to parse '.../site/.git/arc/config' as JSON.
Parse error on line 1 at column 0: Expected one of: 'STRING', 'NUMBER', 'NULL', 'TRUE', 'FALSE', '{', '['
(Run with --trace for a full exception trace.)

And that's because:

$ cat .git/arc/config
{}

Should an empty .git/arc/config really be an error? I think arc made that itself at some point.

D9704