def main(): os.chdir(src_dir) if sys.argv[1:] == ['--help']: sys.exit(gjslint.main()) if len(sys.argv) > 1: sys.stderr.write('No arguments allowed') sys.exit(1) sys.argv.append('--strict') sys.argv.append('--unix_mode') sys.argv.append('--check_html') sys.argv.extend(['-r', 'src/']) sys.argv.extend(['-r', 'third_party/tvcm/src/']) gjslint.main()
def _MainImpl(paths_to_lint): from closure_linter import gjslint if sys.argv[1:] == ['--help']: sys.exit(gjslint.main()) if len(sys.argv) > 1: sys.stderr.write('No arguments allowed') sys.exit(1) sys.argv.append('--strict') sys.argv.append('--unix_mode') sys.argv.append('--check_html') for p in paths_to_lint: sys.argv.extend(['-r', os.path.relpath(p)]) gjslint.main()
#!/usr/bin/env python # snipped thanks to # http://stackoverflow.com/questions/279237/python-import-a-module-from-a-folder import os, sys, inspect cmd_subfolder = os.path.realpath(os.path.abspath(os.path.join(os.path.split(inspect.getfile( inspect.currentframe() ))[0],"gflags"))) if cmd_subfolder not in sys.path: sys.path.insert(0, cmd_subfolder) from closure_linter import gjslint gjslint.main()
#!/usr/bin/env python from closure_linter import gjslint import errorrules if __name__ == '__main__': errorrules.InjectErrorReporter() gjslint.main()
def check_files(filenames): fake_args = [gjslint.__file__, '--nobeep'] + filenames return gjslint.main(argv=fake_args) == 0
def check_files(filenames): fake_args = [gjslint.__file__, "--nobeep"] + filenames return gjslint.main(argv=fake_args) == 0
def check_file(filename): fake_args = [gjslint.__file__, '--nobeep', filename] return gjslint.main(argv=fake_args) == 0
#!/usr/bin/env python from closure_linter import errors from closure_linter import errorrules import closure_linter import sys orig = errorrules.ShouldReportError def reportp(error): return error not in ( errors.INVALID_JSDOC_TAG, errors.MISSING_JSDOC_TAG_DESCRIPTION, errors.UNNECESSARY_DOUBLE_QUOTED_STRING, errors.LINE_TOO_LONG, ) and orig (error) errorrules.ShouldReportError = reportp if __name__ == '__main__': if len(sys.argv) > 1 and sys.argv[1] == "fix": from closure_linter import fixjsstyle closure_linter.fixjsstyle.main(["fixjsstyle", "qp.js", "app.js"]) else: from closure_linter import gjslint gjslint.main(["gjslint", "qp.js", "app.js"])