Page MenuHomePhabricator

Add external-json linter
AbandonedPublic

Authored by bgamari on Nov 22 2015, 8:04 PM.
Tags
None
Referenced Files
Unknown Object (File)
Fri, Dec 20, 5:19 PM
Unknown Object (File)
Thu, Dec 19, 7:09 PM
Unknown Object (File)
Sun, Dec 15, 6:50 PM
Unknown Object (File)
Sat, Dec 14, 12:05 AM
Unknown Object (File)
Tue, Dec 10, 9:40 AM
Unknown Object (File)
Wed, Nov 27, 3:52 AM
Unknown Object (File)
Nov 24 2024, 10:27 AM
Unknown Object (File)
Nov 23 2024, 11:36 AM
Subscribers

Details

Summary

This provides a facility for implementing external linters which can
report violations via a JSON representation.

Test Plan

Try it

Diff Detail

Branch
master
Lint
Lint Passed
Unit
Tests Passed
Build Status
Buildable 8980
Build 10544: arc lint + arc unit

Event Timeline

bgamari retitled this revision from to Add external-json linter.
bgamari updated this object.
bgamari edited the test plan for this revision. (Show Details)
This revision now requires changes to proceed.Nov 22 2015, 9:05 PM
bgamari edited edge metadata.

Correct comments

epriestley edited edge metadata.

Per T9827, I currently believe this would be used by only one install and don't want to bring it upstream without seeing much broader interest first.

This revision now requires changes to proceed.Nov 22 2015, 10:40 PM

This code looks good to me in a technical sense, we just don't want to take over maintaining it. Two minor suggestions:

  • phutil_utf8_strtolower() has better behavior than strtolower() on some utf8 inputs.
  • phutil_json_decode() has better behavior (throws a detailed exception) on invalid JSON than json_decode() (returns false).

We don't currently have a way to, say, sign an extension as "this code is broadly reasonable and won't root your box or destroy your data, just not something the upstream wants to maintain or take responsibility for", but we might after T5055.

This code looks good to me in a technical sense, we just don't want to take over maintaining it. Two minor suggestions:

  • phutil_utf8_strtolower() has better behavior than strtolower() on some utf8 inputs.
  • phutil_json_decode() has better behavior (throws a detailed exception) on invalid JSON than json_decode() (returns false).

Thanks for the review!

We don't currently have a way to, say, sign an extension as "this code is broadly reasonable and won't root your box or destroy your data, just not something the upstream wants to maintain or take responsibility for", but we might after T5055.

Sure. I'll be putting the code up here.