0
0
Fork 0
mirror of https://github.com/denoland/deno.git synced 2024-10-31 09:14:20 -04:00
denoland-deno/tools/lint.py
Chris Bystrek 6a649012bc Changed tools/lint.py to lint the entire js and tests directories. (#900)
* Changed tools/lint.py to lint the entire js and tests directorys and sub directories, currently it was pointing at tsconfig and would only lint files that were part of js/main.ts or node_modules/typescript/lib/lib.esnext.d.ts and their dependencies

* Broke the typescript linting out into separate steps for the main typescript programing and tests.

* Fixed linting issues in ts tests.
2018-10-05 07:29:55 -04:00

22 lines
776 B
Python
Executable file

#!/usr/bin/env python
# Does google-lint on c++ files and ts-lint on typescript files
import os
from util import enable_ansi_colors, run
enable_ansi_colors()
root_path = os.path.dirname(os.path.dirname(os.path.realpath(__file__)))
third_party_path = os.path.join(root_path, "third_party")
cpplint = os.path.join(third_party_path, "cpplint", "cpplint.py")
tslint = os.path.join(third_party_path, "node_modules", "tslint", "bin",
"tslint")
os.chdir(root_path)
run([
"python", cpplint, "--filter=-build/include_subdir", "--repository=src",
"--extensions=cc,h", "--recursive", "src/."
])
run(["node", tslint, "-p", ".", "--exclude", "**/gen/**/*.ts"])
run(["node", tslint, "./js/**/*_test.ts", "./tests/**/*.ts", "--exclude", "**/gen/**/*.ts"])