diff --git a/linter.py b/linter.py index a55dd63..f3f5214 100644 --- a/linter.py +++ b/linter.py @@ -17,6 +17,7 @@ class Phpcs(Linter): """Provides an interface to phpcs.""" syntax = ('php', 'html', 'html 5') + cmd = ('phpcs', '--report=checkstyle', '${args}', '-') regex = ( r'.*line="(?P\d+)" ' r'column="(?P\d+)" ' @@ -24,20 +25,7 @@ class Phpcs(Linter): r'message="(?P.*)" source' ) defaults = { + # we want auto-substitution of the filename, but `cmd` does not support that yet + '--stdin-path=': '${file}', '--standard=': 'PSR2', } - inline_overrides = ('standard') - tempfile_suffix = 'php' - - def cmd(self): - """Read cmd from inline settings.""" - settings = Linter.get_view_settings(self) - - if 'cmd' in settings: - command = [settings.get('cmd')] - else: - command = ['phpcs'] - - command.append('--report=checkstyle') - - return command