Skip to content

Resolve SublimeLinter depreciations. Document need for Dockerfile syntax #1

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,10 @@ Before installing this plugin, you must ensure that `dockerfilelint` is installe

**Note:** This plugin requires `dockerfilelint` 1.4.0 or later.

You must also install the Dockerfile syntax definitions available for Sublime Text under package control. Search for Dockerfile Syntax Highlighting.

https://packagecontrol.io/packages/Dockerfile%20Syntax%20Highlighting

### Linter configuration
In order for `dockerfilelint` to be executed by SublimeLinter, you must ensure that its path is available to SublimeLinter. Before going any further, please read and follow the steps in [“Finding a linter executable”](http://sublimelinter.readthedocs.org/en/latest/troubleshooting.html#finding-a-linter-executable) through [“Validating your PATH”](http://www.sublimelinter.com/en/latest/troubleshooting.html#validating-your-path) in the documentation.

Expand Down
14 changes: 4 additions & 10 deletions linter.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,30 +16,24 @@

class Dockerfilelint(Linter):
"""Provides an interface to dockerfilelint."""

syntax = 'dockerfile'
cmd = 'dockerfilelint --json'
executable = 'dockerfilelint'
version_args = '--version'
version_re = r'(?P<version>\d+\.\d+\.\d+)'
version_requirement = '>= 1.4.0'
config_file = ('.dockerfilelintrc', '~')

# The following regex parses text in format <file>:<line>:<error>:<message>\n
#
# Possible Bug & Deprecation marked as errors
#
# Optimization & Clarity marked as warnings

regex = (
r'^.+?:(?P<line>\d+):'
r'(?:(?P<error>Possible Bug|Deprecation|)|(?P<warning>Optimization|Clarity|)):'
r'(?P<message>.+)$\r?\n'
)

multiline = True
error_stream = util.STREAM_STDOUT
selectors = {}
defaults = {}
defaults = {
'selector': 'source.dockerfile'
}

def run(self, cmd, code):
output = super().run(cmd, code)
Expand Down