Page MenuHomePhabricator

Better handling of `.arcconfig` files.
ClosedPublic

Authored by joshuaspence on Jun 23 2014, 4:05 AM.
Tags
None
Referenced Files
Unknown Object (File)
Wed, Dec 18, 11:52 PM
Unknown Object (File)
Wed, Dec 18, 11:52 PM
Unknown Object (File)
Wed, Dec 18, 11:51 PM
Unknown Object (File)
Fri, Dec 13, 12:44 PM
Unknown Object (File)
Tue, Dec 10, 11:51 AM
Unknown Object (File)
Sun, Dec 8, 2:19 AM
Unknown Object (File)
Thu, Dec 5, 6:41 AM
Unknown Object (File)
Tue, Dec 3, 3:51 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