1
0
Fork 0
mirror of https://we.phorge.it/source/arcanist.git synced 2024-09-20 08:58:55 +02:00
No description
Find a file
epriestley 9cd098ca01 Add "ArcanistSingleLintEngine" and "ArcanistScriptAndRegexLinter"
Summary:
Request from @csilvers. Allow installs to get most linter features with regexes, configuration and external scripts if they are hesitant to write phutil libraries.

  - Add "ArcanistSingleLintEngine", which implements the smallest possible engine behavior (run one linter on every path).
  - Add "ArcanistScriptAndRegexLinter", which uses a script and a regex to parse lint output from other scripts.

Depends on D2618.

Test Plan:
Basics:

  $ arc set-config lint.engine ArcanistSingleLintEngine
  Set key 'lint.engine' = 'ArcanistSingleLintEngine'.
  $ arc set-config lint.engine.single.linter ArcanistScriptAndRegexLinter
  Set key 'lint.engine.single.linter' = 'ArcanistScriptAndRegexLinter'.
  $ arc set-config linter.scriptandregex.script 'echo derp #'
  Set key 'linter.scriptandregex.script' = 'echo derp #'.
  $ arc set-config linter.scriptandregex.regex '/^(?P<message>.*)$/m'
  Set key 'linter.scriptandregex.regex' = '/^(?P<message>.*)$/m'.
  $ arc lint
  >>> Lint for .arcconfig:

     Error  (S&RX) Lint
      derp

                 1 {
                 2   "project_id" : "arcanist",
                 3   "conduit_uri" : "https://secure.phabricator.com/",

Throw:

  $ arc set-config linter.scriptandregex.regex '/^(?P<throw>.*)$/m'
  Set key 'linter.scriptandregex.regex' = '/^(?P<throw>.*)$/m' (was '/^(?P<message>.*)$/m').
  $ arc lint
  Usage Exception: ArcanistScriptAndRegexLinter: configuration captured a 'throw' named capturing group, 'derp'. Script output:
  derp

Ignore:

  $ arc set-config linter.scriptandregex.regex '/^(?P<ignore>.*)$/m'
  Set key 'linter.scriptandregex.regex' = '/^(?P<ignore>.*)$/m' (was '/^(?P<throw>.*)$/m').
  $ arc lint
   OKAY  No lint warnings.

Severity:

  $ arc set-config linter.scriptandregex.regex '/^(?P<warning>.)(?P<message>.*)$/m'
  Set key 'linter.scriptandregex.regex' = '/^(?P<warning>.)(?P<message>.*)$/m' (was '/^(?P<ignore>.*)$/m').
  $ arc lint
  >>> Lint for src/lint/engine/single/ArcanistSingleLintEngine.php:

     Warning  (S&RX) Lint
      erp

                 1 <?php
                 2
                 3 /*

Reviewers: csilvers, btrahan, vrana

Reviewed By: csilvers

CC: aran

Differential Revision: https://secure.phabricator.com/D2619
2012-05-31 12:09:01 -07:00
bin Minor, correct arc handling of relative symlinking (from @makinde). 2012-04-02 16:33:36 -07:00
externals arc lint: fix/enable PEP8 linter 2011-05-18 16:47:23 -07:00
resources Provide a simpler analyzer script for killing __init__.php 2012-05-24 10:56:56 -07:00
scripts Allow global config to load libraries and set test engines 2012-05-31 11:41:39 -07:00
src Add "ArcanistSingleLintEngine" and "ArcanistScriptAndRegexLinter" 2012-05-31 12:09:01 -07:00
.arcconfig Automatically detect when to mark revisions committed 2011-09-27 11:06:02 -07:00
.divinerconfig Fix docs links after D2181 and D2182 2012-04-10 11:32:09 -07:00
.gitignore Pre-fill template fields under "arc diff --create" in git 2012-02-28 17:00:35 -08:00
LICENSE Initial commit. 2011-01-09 15:22:25 -08:00
README Update Arcanist README text 2011-11-06 18:12:50 -08:00

WHAT IS ARCANIST?

Arcanist is the command-line tool for Phabricator. It allows you to interact
with Phabricator installs to send code for review, download patches, transfer
files, view status, make API calls, and various other things. You can find
a complete user guide here:

  http://www.phabricator.com/docs/phabricator/article/Arcanist_User_Guide.html

For more information about Phabricator, see:

  http://phabricator.org/