Skip to content

Commit

Permalink
Attempt to ignore stderr to support phpstan.neon configs. (#9)
Browse files Browse the repository at this point in the history
Attempt to ignore stderr to support phpstan.neon configs. Fixes #2
  • Loading branch information
Rockstar04 authored Oct 25, 2019
2 parents 2a6121b + 186db47 commit 6faae8a
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions linter.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,22 +3,23 @@
import logging
import re

from SublimeLinter.lint import Linter
from SublimeLinter import lint

logger = logging.getLogger("SublimeLinter.plugins.phpstan")

AUTOLOAD_OPT_RE = re.compile(r"(-a|--autoload-file)\b")


class PhpStan(Linter):
class PhpStan(lint.Linter):
regex = r"^(?!Note: ).*:(?P<line>[0-9]+):(?P<message>.+)"
error_stream = lint.STREAM_STDOUT
default_type = "error"
multiline = False
tempfile_suffix = "-"
defaults = {
"selector": "source.php",
"use_composer_autoload": True,
"--level": "max",
"--level": "max"
}

def cmd(self):
Expand All @@ -41,8 +42,7 @@ def cmd(self):
return []

opts.append("--autoload-file={}".format(quote(autoload_file)))

return cmd + opts + ["${args}", "--", "${file}"]
return cmd + opts + ["${args}", "--", "${file}"]

def get_cmd(self):
# We need to patch `get_cmd` to handle empty return values from `cmd`.
Expand Down

0 comments on commit 6faae8a

Please sign in to comment.