Page MenuHomePhabricator

Arcanist does not aggregate exceptions pertaining to missing external linters.
Closed, InvalidPublic

Description

Arcanist does not aggregate exceptions pertaining to missing external linters. We have four external linters configured (ArcanistCSSLintLinter, ArcanistLesscLinter, ArcanistJSHintLinter and ArcanistJSONLintLinter) and new devs end up doing something like this:

  1. Writing some code.
  2. arc diff
  3. Arcanist throws an exception because csslint is not installed.
  4. sudo npm install -g csslint
  5. arc diff
  6. Arcanist throws an exception because lessc is not installed.
  7. sudo npm install -g less
  8. arc diff
  9. Arcanist throws an exception because jshint is not installed.
  10. sudo npm install -g jshint
  11. arc diff
  12. Arcanist throws an exception because jsonlint is not installed.
  13. sudo npm install -g jsonlint
  14. arc diff (finally...)

This process is pretty painful and could be handled a lot better by allowing these exceptions to aggregate and just throwing a PhutilAggregateException instead. Probably we should define a new subclass of ArcanistUsageException for ArcanistExternalLinterException to differentiate these types of exceptions.

Event Timeline

joshuaspence raised the priority of this task from to Needs Triage.
joshuaspence updated the task description. (Show Details)
joshuaspence added a project: Arcanist.
joshuaspence added a subscriber: joshuaspence.

It appears that I was wrong about this... I just tested this out and received the following output:

> arc lint
Exception
Some linters failed:
    - ArcanistCpplintLinter: ArcanistUsageException: Unable to locate binary "cpplint.py" to run linter ArcanistCpplintLinter. You may need to install the binary, or adjust your linter configuration. 
      TO INSTALL: Install cpplint.py using `wget http://google-styleguide.googlecode.com/svn/trunk/cpplint/cpplint.py`.
    - ArcanistClosureLinter: ArcanistUsageException: Unable to locate binary "gjslint" to run linter ArcanistClosureLinter. You may need to install the binary, or adjust your linter configuration. 
      TO INSTALL: Install gJSLint using `sudo easy_install http://closure-linter.googlecode.com/files/closure_linter-latest.tar.gz`
(Run with --trace for a full exception trace.)