Python-unittest integration for jslint.
This package integrates the JSHint code analysis tool (http://jshint.com) with Python’s unittest module. (The name is left over from when JSHint didn’t exist and only Douglas Crockford’s JSLint was available.)
To use it, create a test class like this:
class MyJSLintTest(gocept.jslint.TestCase): include = ('my.package.browser:js', 'my.package.browser:js/lib') options = (gocept.jslint.TestCase.options + ('browser', 'jquery',))
include is a list of “resource paths” of the form packagename:path (passed to pkg_resources).
options is a list of arguments that are passed to JSHint (see its documentation for details).
predefined is a list of global names that should be considered predefined (for use with the undef option).
exclude can be a list of filenames (without path) that will not be collected.
All files ending in .js contained in each of these paths will be collected, and the test class will grow a method named test_jslint_filename.js.
You can ignore JSLint error by setting ignore on the test class (a list of substrings that are matched against each JSLint output line):
- ignore = (
- “Use a named parameter”, )
gocept.jslint is tested with Python 2.7, 3.6 and 3.7.
gocept.jslint uses node.js to run jshint, so you need to have node.js (version 0.3 or later) with the jshint npm module installed and the jshint binary available on your $PATH.
You can customize the name of the jshint binary by setting jshint_command on the TestCase, or set the environment variable JSHINT_COMMAND.
- Add support for Python 3.6 and 3.7.
- Stop testing with Python 2.6.
- Run the tests against currently most recent versions of the dependencies.
- Change testrunner to py.test.
- Get jshint command from environment (#13073).
- Use jshint instead of jslint.
- Uniquify duplicate file names in a prettier way: increment a counter, don’t just blindly append ‘_1’ (#9454).
- Add support for linting JS files contained in zipped eggs (#9453).
- Add an entry point for running jslint from the command line (#9449).
- Skip tests if node.js is not available. Skipping tests only works properly in Python >= 2.7, though. (#9458)
- Implement custom error ignores (#9456).
- first release.
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
|Filename, size||File type||Python version||Upload date||Hashes|
|Filename, size gocept.jslint-2.0.tar.gz (6.7 kB)||File type Source||Python version None||Upload date||Hashes View|