Page MenuHomePhabricator

ArcanistCSSLintLinter: Parameter passed to "setLine()" must be an integer
Closed, ResolvedPublic

Description

csslint offers some diagnostics related to all the document without any relevant line number (tested against csslint v0.10.0, the version offered by npm install -g csslint).

For example, report could include <issue severity="warning" reason="You have 2 h4s defined in this stylesheet." evidence=""/>

In such case, arc lint fails and the exception Parameter passed to "setLine()" must be an integer. is thrown.

Sample CSS code to repro

h4 {
    font-family: 'Open Sans', Helvetica, Arial, sans-serif;
}

.footer  h4 {
   color: white;
}

Stacktrace

>>> [8] <exec> $ 'csslint' '--format=lint-xml' '/tmp/ArcanistCSSLintLinter-issue/multi-headings.css'
<<< [6] <lint> 23,149 us
>>> [9] <lint> CSSLint <paths = 1>
<<< [8] <exec> 460,894 us
<<< [9] <lint> 458,375 us

[2015-11-17 04:16:53] EXCEPTION: (PhutilAggregateException) Some linters failed:
    - Exception: Parameter passed to "setLine()" must be an integer. at [<arcanist>/src/lint/engine/ArcanistLintEngine.php:274]
arcanist(head=production, ref.master=66ab1c955d27, ref.production=6573dedafdbd), phutil(head=master, ref.master=e9ed72483a14)
  #0 <#2> ArcanistLintMessage::validateInteger(string, string) called at [<arcanist>/src/lint/ArcanistLintMessage.php:75]
  #1 <#2> ArcanistLintMessage::setLine(string) called at [<arcanist>/src/lint/linter/ArcanistCSSLintLinter.php:72]
  #2 <#2> ArcanistCSSLintLinter::parseLinterOutput(string, integer, string, string) called at [<arcanist>/src/lint/linter/ArcanistExternalLinter.php:437]
  #3 <#2> ArcanistExternalLinter::resolveFuture(string, ExecFuture) called at [<arcanist>/src/lint/linter/ArcanistFutureLinter.php:34]
  #4 <#2> ArcanistFutureLinter::didLintPaths(array) called at [<arcanist>/src/lint/engine/ArcanistLintEngine.php:594]
  #5 <#2> ArcanistLintEngine::executeDidLintOnPaths(ArcanistCSSLintLinter, array) called at [<arcanist>/src/lint/engine/ArcanistLintEngine.php:545]
  #6 <#2> ArcanistLintEngine::executeLintersOnChunk(array, array) called at [<arcanist>/src/lint/engine/ArcanistLintEngine.php:473]
  #7 <#2> ArcanistLintEngine::executeLinters(array) called at [<arcanist>/src/lint/engine/ArcanistLintEngine.php:216]
  #8 ArcanistLintEngine::run() called at [<arcanist>/src/workflow/ArcanistLintWorkflow.php:334]
  #9 ArcanistLintWorkflow::run() called at [<arcanist>/scripts/arcanist.php:382]