Skip to content
Open
Show file tree
Hide file tree
Changes from 2 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