diff --git a/.travis.yml b/.travis.yml index 96dcaac..f6e9a46 100644 --- a/.travis.yml +++ b/.travis.yml @@ -9,4 +9,4 @@ install: # Command to run the tests. script: - - python test.py + - nosetests scame/ diff --git a/release-notes.rst b/release-notes.rst index d1cad64..5fdaf50 100644 --- a/release-notes.rst +++ b/release-notes.rst @@ -1,3 +1,10 @@ +scame-0.5.0 - 2018/09/11 +======================== + +* Switch from deprecated Google Closure Linter to Chevah JS Linter. +* Allow passing full command line arguments to chevah js linter. + + scame-0.4.2 - 2017/10/29 ======================== @@ -9,7 +16,7 @@ scame-0.4.1 - 2017/10/29 * Force flush the output on progress. - + scame-0.4.0 - 2017/10/29 ======================== diff --git a/scame/__version__.py b/scame/__version__.py index a097352..3d2e842 100644 --- a/scame/__version__.py +++ b/scame/__version__.py @@ -1,4 +1,4 @@ """ Keeps the version of the project. """ -VERSION = '0.4.2' +VERSION = '0.5.0' diff --git a/scame/formatcheck.py b/scame/formatcheck.py index a3b186f..cbaab35 100755 --- a/scame/formatcheck.py +++ b/scame/formatcheck.py @@ -268,12 +268,14 @@ def __init__(self): 'max_complexity': -1 } - self.closure_linter = { + self.chevah_js_linter = { # Disabled by default, since jslint is the default linter. 'enabled': False, - # List of Google Closure Errors to ignore. + # List of errors to ignore. # Ex 110 is line to long which is already provided by pocket-lint. 'ignore': [110], + # Extra flags to pass to linter. + 'flags': [] } # See pycodestyle.StyleGuide for available options. @@ -1047,14 +1049,14 @@ class JavascriptChecker(BaseChecker, AnyTextMixin): def check(self): """Check the syntax of the JavaScript code.""" - self.check_closure_linter() + self.check_chevah_js_linter() self.check_text() self.check_windows_endlines() - def check_closure_linter(self): - """Check file using Google Closure Linter.""" + def check_chevah_js_linter(self): + """Check file using Chevah JS Linter.""" - options = self.options.get('closure_linter', self.file_path) + options = self.options.get('chevah_js_linter', self.file_path) if not options['enabled']: return @@ -1062,6 +1064,9 @@ def check_closure_linter(self): from closure_linter import runner from closure_linter.common import erroraccumulator + import gflags as flags + flags.FLAGS(['scame-js-linter'] + options['flags']) + error_handler = erroraccumulator.ErrorAccumulator() runner.Run(self.file_path, error_handler) for error in error_handler.GetErrors():