Page MenuHomePhabricator

Fix linter config check
ClosedPublic

Authored by avivey on Nov 2 2014, 2:25 AM.
Tags
None
Referenced Files
F14096487: D10773.diff
Tue, Nov 26, 3:43 AM
Unknown Object (File)
Sat, Nov 23, 3:25 AM
Unknown Object (File)
Fri, Nov 22, 6:27 PM
Unknown Object (File)
Fri, Nov 22, 9:48 AM
Unknown Object (File)
Fri, Nov 22, 9:07 AM
Unknown Object (File)
Sun, Nov 17, 10:37 PM
Unknown Object (File)
Thu, Nov 14, 5:18 AM
Unknown Object (File)
Sun, Nov 10, 3:44 AM
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
Branch
arcpatch-D10773
Lint
Lint Passed
Unit
Tests Passed
Build Status
Buildable 3524
Build 3532: [Placeholder Plan] Wait for 30 Seconds

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
358

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
355–359

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

357

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
355–359

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.