Skip to content

Commit

Permalink
ESLintBear: Handle empty files
Browse files Browse the repository at this point in the history
  • Loading branch information
RaitoBezarius authored and sils committed Aug 19, 2016
1 parent 71436f7 commit d30cc4f
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
3 changes: 3 additions & 0 deletions bears/js/ESLintBear.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,9 @@ def create_arguments(filename, file, config_file,
return args

def process_output(self, output, filename, file):
if not file:
return

output = json.loads(output)
lines = "".join(file)

Expand Down
6 changes: 4 additions & 2 deletions tests/js/ESLintBearTest.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,11 +31,13 @@
"eslintconfig.json")

ESLintBearTestWithConfig = verify_local_bear(ESLintBear,
valid_files=(test_good,),
valid_files=(
test_good, ''),
invalid_files=(test_bad,),
settings={"eslint_config":
eslintconfig})

ESLintBearWithoutConfig = verify_local_bear(ESLintBear,
valid_files=(test_good, test_bad),
valid_files=(
test_good, test_bad, ''),
invalid_files=(test_syntax_error,))

0 comments on commit d30cc4f

Please sign in to comment.