Page MenuHomePhabricator

Be more strict with the type of `.arclint` properties.
ClosedPublic

Authored by joshuaspence on May 13 2014, 8:49 AM.
Tags
None
Referenced Files
F13995319: D9089.diff
Wed, Oct 23, 12:09 PM
Unknown Object (File)
Sep 10 2024, 6:30 PM
Unknown Object (File)
Aug 24 2024, 8:50 PM
Unknown Object (File)
Aug 24 2024, 1:10 PM
Unknown Object (File)
Aug 24 2024, 1:25 AM
Unknown Object (File)
Aug 19 2024, 2:39 AM
Unknown Object (File)
Aug 17 2024, 2:42 PM
Unknown Object (File)
Aug 15 2024, 3:36 PM
Subscribers

Details

Summary

Although this provides less context in terms of the error message (for example, Parameter has invalid type. Expected type 'optional regex|list<regex>', got type 'list<string>'.), I think that it is the right approach. I think that PhutilTypeSpec::checkMap should be improved such that additional context is provided in the exception message.

Test Plan

Ran arc lint. Modified .arclint to contain an invalid regex and ran arc lint again.

Diff Detail

Repository
rARC Arcanist
Lint
Lint Skipped
Unit
Tests Skipped

Event Timeline

joshuaspence retitled this revision from to Be more strict with the type of `.arclint` properties..
joshuaspence updated this object.
joshuaspence edited the test plan for this revision. (Show Details)
joshuaspence added a reviewer: epriestley.
epriestley edited edge metadata.

Let's at least improve the error message on the easy one? I don't think PhutilTypeSpec can know about that.

src/lint/engine/ArcanistConfigurationDrivenLintEngine.php
71–86

Here, at least, we should be able to catch and throw a PhutilProxyException like below...

99

(Like this.)

This revision now requires changes to proceed.May 13 2014, 8:14 PM
src/lint/engine/ArcanistConfigurationDrivenLintEngine.php
71–86

Sure, but how can we know which key was invalid?

Just raising the linter key would be helpful -- "There was an error in the configuration for linter "%s": ..." or similar

joshuaspence edited edge metadata.

Use PhutilProxyException to throw a more descriptive error message.

epriestley edited edge metadata.

good enough for government work

This revision is now accepted and ready to land.May 13 2014, 10:17 PM
epriestley updated this revision to Diff 21642.

Closed by commit rARCb744ed9a19ce (authored by @joshuaspence, committed by @epriestley).