Page MenuHomePhabricator

Improve the handling of `.arclint` files.
ClosedPublic

Authored by joshuaspence on Jun 23 2014, 3:25 AM.
Tags
None
Referenced Files
F14398493: D9679.diff
Sun, Dec 22, 2:02 PM
Unknown Object (File)
Mon, Dec 16, 2:18 PM
Unknown Object (File)
Sun, Dec 15, 6:02 AM
Unknown Object (File)
Tue, Dec 10, 3:00 PM
Unknown Object (File)
Mon, Dec 9, 9:27 PM
Unknown Object (File)
Mon, Dec 9, 5:12 PM
Unknown Object (File)
Sun, Dec 8, 4:54 PM
Unknown Object (File)
Tue, Dec 3, 2:32 PM

Details

Summary

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

Test Plan

Modified an .arclint file to be invalid JSON.

> arc lint
Exception
Parse error on line 24 at column 5: Expected one of: 'EOF', '}', ',', ']'
(Run with --trace for a full exception trace.)

Diff Detail

Repository
rARC Arcanist
Branch
arclint-error
Lint
Lint Passed
Unit
No Test Coverage
Build Status
Buildable 1323
Build 1323: [Placeholder Plan] Wait for 30 Seconds

Event Timeline

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

This exception doesn't make it clear that the error is in .arclint, and loses the .arclint path.

You can wrap it in PhutilProxyException to get the best of both worlds, I think.

This revision now requires changes to proceed.Jun 23 2014, 2:10 PM
In D9679#7, @epriestley wrote:

This exception doesn't make it clear that the error is in .arclint, and loses the .arclint path.

You can wrap it in PhutilProxyException to get the best of both worlds, I think.

I agree, but it seems that we don't print the output from proxied exceptions. I'll update the diff and include the output.

joshuaspence edited edge metadata.
  • Wrap exception in PhutilProxyException
> arc lint
Exception
Expected '.arclint' file to be a valid JSON file, but failed to decode it: /home/joshua/workspace/github.com/phacility/arcanist/.arclint
joshuaspence updated this object.
  • Minor improvement to message text.
epriestley edited edge metadata.
This revision is now accepted and ready to land.Jun 23 2014, 11:21 PM