Page MenuHomePhabricator

Linters must include Name fields
Closed, ResolvedPublic

Description

name is a required field of HarbormasterBuildLintMessage objects, but not all linters set a Name field on the lint feedback they produce. This leads to errors during arc diff:

[2015-09-02 00:42:16] EXCEPTION: (ConduitClientException) ERR-CONDUIT-CORE: Missing required parameters: name at [<phutil>/src/conduit/ConduitFuture.php:58]
arcanist(head=master, ref.master=a5304e472d18), dblib(), phutil(head=master, ref.master=dc0626970a6d)
  #0 <#2> ConduitFuture::didReceiveResult(array) called at [<phutil>/src/future/FutureProxy.php:58]
  #1 <#2> FutureProxy::getResult() called at [<phutil>/src/future/FutureProxy.php:35]
  #2 <#2> FutureProxy::resolve() called at [<arcanist>/src/workflow/ArcanistDiffWorkflow.php:2778]
  #3 phlog(ConduitClientException) called at [<arcanist>/src/workflow/ArcanistDiffWorkflow.php:2784]
  #4 ArcanistDiffWorkflow::updateAutotargets(string, integer) called at [<arcanist>/src/workflow/ArcanistDiffWorkflow.php:528]
  #5 ArcanistDiffWorkflow::run() called at [<arcanist>/scripts/arcanist.php:382]

The quick fix is likely to replace setDescription calls with setName calls on linters that only have the latter. I'm happy to provide a diff that does so, if that's an acceptable solution.

Revisions and Commits

Restricted Differential Revision

Event Timeline

alexmv updated the task description. (Show Details)
alexmv added a subscriber: alexmv.

This is also a notable backward-incompatible change to projects which define their own lint engines; all places which generate their own ArcanistLintExceptions by hand need to be checked to ensure that they call setName. This upgrading note likely bears documenting somewhere.

epriestley added a revision: Restricted Differential Revision.Sep 25 2015, 5:02 PM

Prior to, e.g., T8921, we were very lax about lint messages which led to a lot of linters passing nonsense (e.g., non-numeric line numbers, negative character offsets, human-readable durations with units like "3 seconds"). Formalization of lint in connection with T8089 implicitly increased strictness.

After D14165, arc will raise a more explicit error pointing at the problematic linter if a linter does not provide a name.

epriestley closed this task as Resolved by committing Restricted Diffusion Commit.Sep 25 2015, 6:16 PM
epriestley added a commit: Restricted Diffusion Commit.