Page MenuHomePhabricator

Improve handling for missing externals when linting
AbandonedPublic

Authored by joshuaspence on Sep 10 2014, 1:52 PM.
Tags
None
Referenced Files
Unknown Object (File)
Fri, Jan 17, 8:08 PM
Unknown Object (File)
Sun, Dec 22, 7:06 AM
Unknown Object (File)
Dec 7 2024, 9:52 AM
Unknown Object (File)
Nov 28 2024, 2:15 AM
Unknown Object (File)
Nov 26 2024, 2:17 AM
Unknown Object (File)
Nov 1 2024, 2:53 PM
Unknown Object (File)
Oct 16 2024, 1:10 PM
Unknown Object (File)
Oct 1 2024, 3:19 PM
Subscribers

Details

Summary

Fixes T6060. If a dependency of an ArcanistExternalLinter subclass is missing, emit a warning but continue the linting process as much as possible. This is generally a more reasonable behaviour.

Test Plan
> arc lint -- some/file.js
[2014-09-10 13:50:32] PHLOG: 'Unable to locate binary "jshint" to run linter ArcanistJSHintLinter. You may need to install the binary, or adjust your linter configuration. 
TO INSTALL: Install JSHint using `npm install -g jshint`.' at [/home/joshua/workspace/github.com/phacility/arcanist/src/lint/engine/ArcanistLintEngine.php:318]
 OKAY  No lint warnings

Diff Detail

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

Event Timeline

joshuaspence retitled this revision from to Improve handling for missing externals when linting.
joshuaspence updated this object.
joshuaspence edited the test plan for this revision. (Show Details)
joshuaspence added a reviewer: epriestley.
src/lint/engine/ArcanistLintEngine.php
250

Not 100% sure this is the correct approach

318

This can be improved... also, maybe ArcanistUsageException will catch other issues? Do we need a more specific exception subclass?

One concern that I have is that this could cause diffs to show up as "Lint OK" in differential, even if the diff would've failed linting had the dependencies been correctly installed. Perhaps we need a new "Partially linted" status?

I think that we should allow linting to "skip" specific linters in the same way that unit testing allows for. Any linters that are skipped due to missing dependencies can then show up as skipped in the differential UI.

If this sounds reasonable then im happy to send a diff for this (if you know roughly what is involved and could elaborate that would be great too)

Yeah, I'm onboard with skipping and think that's the approach we should pursue. I don't think there are any real traps.