Page MenuHomePhabricator

Fix linter config check
ClosedPublic

Authored by avivey on Nov 2 2014, 2:25 AM.
Tags
None
Referenced Files
Unknown Object (File)
Thu, Apr 25, 3:45 AM
Unknown Object (File)
Tue, Apr 2, 12:32 PM
Unknown Object (File)
Mar 28 2024, 1:50 PM
Unknown Object (File)
Mar 24 2024, 12:35 PM
Unknown Object (File)
Mar 10 2024, 2:03 AM
Unknown Object (File)
Feb 6 2024, 11:00 PM
Unknown Object (File)
Feb 1 2024, 4:37 AM
Unknown Object (File)
Jan 31 2024, 10:37 PM
Subscribers

Details

Summary

Fixes T6311 and T5124 by returning all configured linters from buildLinter(), and making ArcanistExternalLinter::checkBinaryConfiguration() not crash if there's no executable to run.

Test Plan

arc linters in rP shows "Configured" and "ERROR" as appropriate; Adding a broken linter to .arclint in rARC doesn't invoke it's not actually needed, and prints error if it is.

Diff Detail

Repository
rARC Arcanist
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

avivey retitled this revision from to Fix linter config check.
avivey updated this object.
avivey edited the test plan for this revision. (Show Details)

I initially attempted to implement canRun(), but if it's false, the lint engine just ignores the linters. I think it should fail the lint instead.

joshuaspence edited edge metadata.
joshuaspence added inline comments.
src/lint/linter/ArcanistExternalLinter.php
305

I think that returning null would make more sense.

This revision now requires changes to proceed.Dec 17 2014, 8:32 PM
avivey edited edge metadata.

yeah, probably :)

joshuaspence edited edge metadata.

I think you missed something when you updated the diff? It looks exactly the same to me.

This revision now requires changes to proceed.Dec 30 2014, 9:07 AM

Yes, it seems I have forgotten how to arc :p

Updating again...

avivey edited edge metadata.

replace 'n/a' with null

joshuaspence edited edge metadata.

LGTM

src/lint/linter/ArcanistExternalLinter.php
302–306

Since this looks a little out-of-place, I feel that we should comment it.

304

Just a general remark, I really feel that we overuse ArcanistUsageException.

joshuaspence edited the test plan for this revision. (Show Details)
joshuaspence edited edge metadata.

D11205 changes the exception raised here.

I'm not sure this issue still exists any more.

I'm not sure this issue still exists any more.

T6311 still exists for me.

avivey requested a review of this revision.Jan 4 2015, 9:40 PM

I was trying to update it to use ArcanistUsageException, and didn't notice how D11205 hasn't landed yet, and things got weirder from there.

Like, php is fine with trying to catch an exception class that was never defined.

OTOH, once the exception we're catching there is ArcanistUsageException, the whole try-catch-checkBinaryConfiguration block is readable enough, IMO. I'll update it, once it's actually landed...

avivey edited edge metadata.

check for ArcanistMissingLinterException

avivey added inline comments.
src/lint/linter/ArcanistExternalLinter.php
302–306

I think that narrowing the caught exception here resolves these two.

@epriestley, it would be great to land this. Without this fix, arc linters is a bit broken.

This revision is now accepted and ready to land.May 5 2015, 9:02 PM
This revision was automatically updated to reflect the committed changes.