diff --git a/.travis.yml b/.travis.yml index fb62dc4..000f751 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,11 +1,7 @@ language: python python: - - "3.3" -# command to install dependencies + - "3.6" install: - pip install flake8 - - pip install pydocstyle -# command to run tests script: - flake8 . --max-line-length=120 - - pydocstyle . --add-ignore=D202 diff --git a/linter.py b/linter.py index 3463a2e..98c3840 100644 --- a/linter.py +++ b/linter.py @@ -1,27 +1,8 @@ -# -# linter.py -# Linter for SublimeLinter, a code checking framework for Sublime Text 3 -# -# Written by Eric Brown -# Copyright (c) 2016 Eric Brown -# -# License: MIT -# - -"""This module exports the Bandit plugin class.""" - -from SublimeLinter.lint import PythonLinter -from SublimeLinter.lint import util +from SublimeLinter.lint import PythonLinter, util class Bandit(PythonLinter): - """Provides an interface to bandit.""" - - syntax = 'python' - cmd = ('bandit@python', '*', '-n', '1', '-f', 'txt', '-') - version_args = '--version' - version_re = r'^bandit\s(?P\d+.\d+.\d+)' - version_requirement = '>= 1.3.0' + cmd = ('bandit', '${args}', '-n', '1', '-f', 'txt', '-') regex = ( r'^>>\sIssue:\s\[(?P[B]\d+):.+\]\s(?P.+)$\r?\n' r'^.*Severity:\s(?:(?PHigh)|(?P(Medium|Low))).*$\r?\n' @@ -29,9 +10,8 @@ class Bandit(PythonLinter): ) multiline = True error_stream = util.STREAM_BOTH - config_file = ('--ini', '.bandit') defaults = { + 'selector': 'source.python', '--tests,': '', - '--skips,': '', + '--skips,': '' } - inline_overrides = ('tests', 'skips')