diff --git a/tests/hghave.py b/tests/hghave.py --- a/tests/hghave.py +++ b/tests/hghave.py @@ -444,6 +444,10 @@ def has_clang_format(): return matchoutput("clang-format --help", br"^OVERVIEW: A tool to format C/C\+\+[^ ]+ code.") +@check("jshint", "JSHint static code analysis tool") +def has_jshint(): + return matchoutput("jshint --version 2>&1", br"jshint v") + @check("pygments", "Pygments source highlighting library") def has_pygments(): try: diff --git a/tests/test-check-jshint.t b/tests/test-check-jshint.t new file mode 100644 --- /dev/null +++ b/tests/test-check-jshint.t @@ -0,0 +1,12 @@ +#require test-repo jshint hg10 + + $ . "$TESTDIR/helpers-testrepo.sh" + +run jshint on all tracked files ending in .js except vendored dependencies + + $ cd "`dirname "$TESTDIR"`" + + $ testrepohg locate 'set:**.js' \ + > -X mercurial/templates/static/excanvas.js \ + > 2>/dev/null \ + > | xargs jshint