Guest User

Untitled

a guest
Oct 15th, 2018
84
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.81 KB | None | 0 0
  1. # -*- coding: utf-8 -*-
  2. # haml.py - sublimelint package for checking haml files
  3. # Save in your sublimelint folder, for example Mac OSX: ~/Library/Application Support/Sublime Text 2/Packages/SublimeLinter/sublimelinter/modules
  4.  
  5. import re
  6.  
  7. from base_linter import BaseLinter
  8.  
  9. CONFIG = {
  10. 'language': 'ruby haml',
  11. 'executable': 'haml',
  12. 'lint_args': '-c'
  13. }
  14.  
  15.  
  16. class Linter(BaseLinter):
  17. def parse_errors(self, view, errors, lines, errorUnderlines, violationUnderlines, warningUnderlines, errorMessages, violationMessages, warningMessages):
  18. for line in errors.splitlines():
  19. match = re.match(r'^.+(?P<line>\d+):\s+(?P<error>.+)', line)
  20.  
  21. if match:
  22. error, line = match.group('error'), match.group('line')
  23. self.add_message(int(line), lines, error, errorMessages)
Add Comment
Please, Sign In to add comment