Page MenuHomePhabricator

Better handling of `.arcconfig` files.
ClosedPublic

Authored by joshuaspence on Jun 23 2014, 4:05 AM.
Tags
None
Referenced Files
F13096580: D9681.id23229.diff
Thu, Apr 25, 5:31 PM
F13096579: D9681.id23229.diff
Thu, Apr 25, 5:31 PM
F13096578: D9681.id23229.diff
Thu, Apr 25, 5:31 PM
F13096014: D9681.id23292.diff
Thu, Apr 25, 1:46 PM
F13084348: D9681.diff
Wed, Apr 24, 10:55 PM
Unknown Object (File)
Tue, Apr 23, 7:21 PM
Unknown Object (File)
Wed, Apr 17, 2:48 PM
Unknown Object (File)
Wed, Apr 10, 6:15 AM

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
Lint
Lint Skipped
Unit
Tests Skipped

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