Created
May 31, 2012 14:34
-
-
Save Tuxified/2843797 to your computer and use it in GitHub Desktop.
HAML linter settings/module for Sublime Text 2 - SublimeLinter
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# -*- coding: utf-8 -*- | |
# haml.py - sublimelint package for checking haml files | |
# Save in your sublimelint folder, for example Mac OSX: ~/Library/Application Support/Sublime Text 2/Packages/SublimeLinter/sublimelinter/modules | |
import re | |
from base_linter import BaseLinter | |
CONFIG = { | |
'language': 'ruby haml', | |
'executable': 'haml', | |
'lint_args': '-c' | |
} | |
class Linter(BaseLinter): | |
def parse_errors(self, view, errors, lines, errorUnderlines, violationUnderlines, warningUnderlines, errorMessages, violationMessages, warningMessages): | |
for line in errors.splitlines(): | |
match = re.match(r'^.+(?P<line>\d+):\s+(?P<error>.+)', line) | |
if match: | |
error, line = match.group('error'), match.group('line') | |
self.add_message(int(line), lines, error, errorMessages) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment