Skip to content

Commit

Permalink
Merge pull request #13 from SublimeLinter/kaste-patch-1
Browse files Browse the repository at this point in the history
Cleanup for SL4
  • Loading branch information
kaste authored Mar 5, 2018
2 parents b703b7b + 415844b commit 78d6ab6
Showing 1 changed file with 2 additions and 28 deletions.
30 changes: 2 additions & 28 deletions linter.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,23 +10,14 @@

"""This module exports the Phpmd plugin class."""

import SublimeLinter.lint
from SublimeLinter.lint import Linter

if getattr(SublimeLinter.lint, 'VERSION', 3) > 3:
from SublimeLinter.lint import const
WARNING = const.WARNING
else:
from SublimeLinter.lint import highlight
WARNING = highlight.WARNING
from SublimeLinter.lint import Linter, WARNING


class Phpmd(Linter):
"""Provides an interface to phpmd."""

syntax = ('php', 'html', 'html 5')
cmd = 'phpmd @ text'
executable = 'phpmd'
cmd = ('phpmd', '@', 'text')
regex = (
r'(?P<filename>.+):(?P<line>\d+)'
r'\s*(?P<message>.+)$'
Expand All @@ -36,20 +27,3 @@ class Phpmd(Linter):
defaults = {
'@rulesets:,': 'cleancode,codesize,controversial,design,naming,unusedcode'
}
inline_overrides = 'rulesets'
comment_re = r'\s*<!--'

def cmd(self):
"""Create the cmd."""
settings = Linter.get_view_settings(self)

# attempt to get the command from settings if it is present
if 'cmd' in settings:
command = [settings.get('cmd')]
else:
command = [self.executable_path]

command.append('@')
command.append('text')

return command

0 comments on commit 78d6ab6

Please sign in to comment.