Skip to content

Commit

Permalink
Fix cls.syntax deprecation warning and use args
Browse files Browse the repository at this point in the history
In Sublime Text 3, there is was a `cls.syntax` deprecation warning in
the console as a result of using:

```python
syntax = 'ruby haml'
```

This removes this warning by using the `selector` configuration:

```python
defaults = {
    'selector': 'text.haml'
}
```

On top of this, it is no longer required to have `.haml-lint.yml`
present and `haml_lint` can make use of the default linting rules.

The `args` and `temp_file` to lint can be specified in the
`SublimeLinter.sublime-settings` file.
  • Loading branch information
TomasBarry committed Apr 27, 2019
1 parent b76afa5 commit 5bfe0fb
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 11 deletions.
5 changes: 1 addition & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,10 +34,7 @@ The docs cover [troubleshooting PATH configuration](http://sublimelinter.com/en/
The default configuration is as follows:

```
'--config': '${folder}/.haml-lint.yml',
'env': {
'HAML_LINT_RUBOCOP_CONF': '${folder}/.rubocop.yml'
}
'selector': 'text.haml'
```

If you have your configuration files somewhere else or with a different name, set this using the Linter settings.
Expand Down
10 changes: 3 additions & 7 deletions linter.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
# linter.py
# Linter for SublimeLinter3, a code checking framework for Sublime Text 3
#
# Written by Jeroen Jacobs
# Written by Jeroen Jacobs & Tomas Barry
# Copyright (c) 2014 Jeroen Jacobs
#
# License: MIT
Expand All @@ -16,14 +16,10 @@
class HamlLint(RubyLinter):
"""Provides an interface to haml-lint."""

syntax = 'ruby haml'
cmd = 'ruby -S haml-lint'
cmd = 'ruby -S haml-lint ${args} ${temp_file}'
regex = r'^.+?:(?P<line>\d+) \[(:?(?P<warning>W)|(?P<error>E))\] (?P<message>.+)'
tempfile_suffix = 'haml'

defaults = {
'--config': '${folder}/.haml-lint.yml',
'env': {
'HAML_LINT_RUBOCOP_CONF': '${folder}/.rubocop.yml'
}
'selector': 'text.haml'
}

0 comments on commit 5bfe0fb

Please sign in to comment.