Skip to content

Commit 21c91a9

Browse files
authored
Update for SL4 (#26)
Basically, enabling linting via STDIN
1 parent ea70689 commit 21c91a9

1 file changed

Lines changed: 3 additions & 15 deletions

File tree

linter.py

Lines changed: 3 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -17,27 +17,15 @@ class Phpcs(Linter):
1717
"""Provides an interface to phpcs."""
1818

1919
syntax = ('php', 'html', 'html 5')
20+
cmd = ('phpcs', '--report=checkstyle', '${args}', '-')
2021
regex = (
2122
r'.*line="(?P<line>\d+)" '
2223
r'column="(?P<col>\d+)" '
2324
r'severity="(?:(?P<error>error)|(?P<warning>warning))" '
2425
r'message="(?P<message>.*)" source'
2526
)
2627
defaults = {
28+
# we want auto-substitution of the filename, but `cmd` does not support that yet
29+
'--stdin-path=': '${file}',
2730
'--standard=': 'PSR2',
2831
}
29-
inline_overrides = ('standard')
30-
tempfile_suffix = 'php'
31-
32-
def cmd(self):
33-
"""Read cmd from inline settings."""
34-
settings = Linter.get_view_settings(self)
35-
36-
if 'cmd' in settings:
37-
command = [settings.get('cmd')]
38-
else:
39-
command = ['phpcs']
40-
41-
command.append('--report=checkstyle')
42-
43-
return command

0 commit comments

Comments
 (0)