Page MenuHomePhabricator

Modify `.arclint` file format to be INI instead of JSON.
AbandonedPublic

Authored by joshuaspence on May 6 2014, 10:28 PM.
Tags
None
Referenced Files
F14015324: D8999.id21371.diff
Sun, Nov 3, 5:33 PM
Unknown Object (File)
Fri, Oct 11, 10:15 PM
Unknown Object (File)
Sep 21 2024, 6:08 PM
Unknown Object (File)
Sep 21 2024, 6:04 PM
Unknown Object (File)
Sep 21 2024, 6:04 PM
Unknown Object (File)
Sep 21 2024, 6:02 PM
Unknown Object (File)
Sep 19 2024, 5:21 AM
Unknown Object (File)
Sep 19 2024, 5:21 AM

Details

Reviewers
epriestley
Group Reviewers
Blessed Reviewers
Maniphest Tasks
Restricted Maniphest Task
Summary

Ref T2039.

Modify the .arclint file format to be INI instead of JSON. In addition, modify the .arclint paths to be a glob rather than a regular expression. These changes generally make the .arclint format much easier to use.

Note that these changes would break backwards compatibility, which we could fix by either:

  1. Attemping to parse the file as JSON if it is not a valid INI.
  2. Creating a new ArcanistLintEngine that understands INI files and leaving the existing ArcanistConfigurationDrivenLintEngine as is.
Test Plan

This isn't quite ready to land, but I wanted to get some initial feedback.

Diff Detail

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

Event Timeline

joshuaspence retitled this revision from to Modify `.arclint` file format to be INI instead of JSON..
joshuaspence updated this object.
joshuaspence edited the test plan for this revision. (Show Details)
joshuaspence added a reviewer: epriestley.
joshuaspence added a task: Restricted Maniphest Task.

Ok, it seems that parse_ini_string requires PHP 5.3.0, but parse_ini_file is fine.

joshuaspence edited edge metadata.

Use parse_ini_file instead of parse_ini_string to ensure compatibility with PHP 5.2.3

I'm pretty happy with the JSON file: I think it's a format pretty much everyone is familiar with (for example, I know all the escaping rules for JSON files), it gives us a way to validate the structure of the file as a whole, and it's consistent with other configuration in arc and Phabricator which is mostly all JSON. It's also easier in most languages to write a tool to generate or curate JSON than .ini.

I think regexps are better too -- they're more powerful, and we generally use them elsewhere. They also give us broader latitude to solve weird support problems by crafting a zany regex instead of having to introduce more complexity elsewhere.

Overall I'd say this just feels premature? Let's wait until users have issues with JSON and/or regexps. If they do, we could swap the formats or allow both.

In both work and personal projects, I prefer JSON over INI for this kind of configuration. It's more flexible and standard, not to mention JSON can be written out in almost any language (whereas INI semantics is not necessarily as widely supported).

Also, regexps is absolutely essential for matching paths correctly.