Page MenuHomePhabricator

Improve the handling of `.arclint` files.
ClosedPublic

Authored by joshuaspence on Jun 23 2014, 3:25 AM.
Tags
None
Referenced Files
F13149981: D9679.diff
Sat, May 4, 12:40 PM
Unknown Object (File)
Fri, May 3, 3:43 AM
Unknown Object (File)
Mon, Apr 29, 2:49 PM
Unknown Object (File)
Thu, Apr 25, 3:20 PM
Unknown Object (File)
Wed, Apr 24, 10:16 PM
Unknown Object (File)
Tue, Apr 16, 5:55 PM
Unknown Object (File)
Sun, Apr 14, 1:12 PM
Unknown Object (File)
Wed, Apr 10, 10:38 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
Lint
Lint Skipped
Unit
Tests Skipped

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