Make sure JSHint linter works properly
Details
Diff Detail
- Repository
- rARC Arcanist
- Branch
- fix-external-linter
- Lint
Lint Passed - Unit
Test Failures - Build Status
Buildable 2488 Build 2492: [Placeholder Plan] Wait for 30 Seconds
Time | Test | |
---|---|---|
0 ms | testJSHintLinter | |
0 ms | testPuppetLintLinter | |
0 ms | testFixLetterCase | |
0 ms | testJSONLinter | |
0 ms | testMergeConflictLint | |
View Full Test Results (2 Failed · 10 Passed · 15 Skipped) |
Event Timeline
This is not the correct change.
When linters override supportsReadDataFromStdin(), that means they can run in a mode like this, and read input from stdin:
cat file.js | linter -
Although we may move away from this in the future, we currently try to do this if a linter supports it, because lint has a "commit hook" mode and there are no files on disk while lint is executing as a commit hook (there is a pending transaction and no working copy).
This patch makes us run this instead:
cat file.js | linter - file.js
This is not correct in the general case.
If JSHint no longer supports reading data from stdin, the correct change is to return false from supportsReadDataFromStdin(). A pointer to a changelog or commit where JSHint dropped support would be helpful.
Ah, damn I missed $future->write($this->getEngine()->loadData($path)); and got confused. Welp then this is definitely not the correct change yeah.
That said the piping doesn't work for me for some reason (although JSHint supports it). I'll investigate.
JSHint does have a --filename flag which is possibly what you are after?
--filename STRING Pass in a filename when using STDIN to emulate config lookup for that file name
@joshuaspence - it does accept input from stdin but it was not working for me for some reason and I was too quick to read the code missing the actual part that passed the input. Apparently it is something related to my own system. Thanks for the heads up tho :)