Giter Site home page Giter Site logo

flarc's People

Contributors

conradolega avatar flnahe avatar igurung avatar kpatfln avatar mmuszynskifln avatar patcadelina avatar pjhrobles avatar thaiphv avatar tot0 avatar wenzhengjiang avatar wtjofreelancer avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

Forkers

lucit-cc

flarc's Issues

Error in ArcanistESLintLinter when more than one file is linted

There is a bug in /src/lint/linter/ArcanistESLintLinter.php in the return statement for parseLinterOutput function

This causes the following error when linting more than 1 file and at least 1 of the files contains no lint errors

How to reproduce

  1. Update fileA.js with something that will trigger eslint
  2. Update fileB.js but this file has no lint problems

run arc lint fileA.js fileB.js and you will get the exception below.

 Exception
Some linters failed:
    - CommandException: Command failed with error #1!

The cause is because the return statement is inside of the foreach instead of outside of it

I have attached a simple diff below that resolves the issue

diff --git a/src/lint/linter/ArcanistESLintLinter.php b/src/lint/linter/ArcanistESLintLinter.php
index da63528..7b23d44 100644
--- a/src/lint/linter/ArcanistESLintLinter.php
+++ b/src/lint/linter/ArcanistESLintLinter.php
@@ -192,9 +192,10 @@ final class ArcanistESLintLinter extends ArcanistBatchExternalLinter {

         $results[] = $result;
       }
-
-      return $results;
     }
+
+    return $results;
+
   }

 }

Exception using ArcanistESLintLinter

->setOriginalText($message['source']);

Looks like the source key is on $file not $message - it is used from there in the auto-fix branch later.

[2019-05-02 19:54:35] ERROR 8: Undefined index: source at [/usr/local/src/.../src/lint/ArcanistESLintLinter.php:157]
arc-...(), arcanist(head=experimental, ref.experimental=637c6584c6ea), phutil(head=master, ref.master=cad1985726c9)
  #0 ArcanistESLintLinter::parseLinterOutput(string, integer, string, string) called at [<arcanist>/src/lint/linter/ArcanistExternalLinter.php:437]
  #1 ArcanistExternalLinter::resolveFuture(string, ExecFuture) called at [<arcanist>/src/lint/linter/ArcanistFutureLinter.php:34]
  #2 ArcanistFutureLinter::didLintPaths(array) called at [<arcanist>/src/lint/engine/ArcanistLintEngine.php:595]
  #3 ArcanistLintEngine::executeDidLintOnPaths(ArcanistESLintLinter, array) called at [<arcanist>/src/lint/engine/ArcanistLintEngine.php:546]
  #4 ArcanistLintEngine::executeLintersOnChunk(array, array) called at [<arcanist>/src/lint/engine/ArcanistLintEngine.php:474]
  #5 ArcanistLintEngine::executeLinters(array) called at [<arcanist>/src/lint/engine/ArcanistLintEngine.php:206]
  #6 ArcanistLintEngine::run() called at [<arcanist>/src/workflow/ArcanistLintWorkflow.php:219]
  #7 ArcanistLintWorkflow::run() called at [<arcanist>/scripts/arcanist.php:420]

Please invite me to the GitHub Community Organization

I was doing code research on the web. I came across your page. And I examined it. I like it so much. Your team and your posts are very helpful. I would love to be with you both to be informed and to support you.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.