def yapf(): print "yapf" qrun( [sys.executable, "third_party/python_packages/bin/yapf", "-i"] + find_exts(["tools", "build_extra", "deno_typescript", "cli_snapshots"], [".py"], skip=["tools/clang"]), env=python_env())
def yapf(): print "yapf" script = os.path.join(third_party_path, "python_packages", "bin", "yapf") source_files = git_ls_files(root_path, ["*.py"]) run([sys.executable, script, "-i", "--"] + source_files, env=python_env(), shell=False, quiet=True)
def pylint(): print "pylint" script = os.path.join(third_party_path, "python_packages", "pylint") rcfile = os.path.join(third_party_path, "depot_tools", "pylintrc") source_files = git_ls_files(root_path, ["*.py", ":!:gclient_config.py"]) run([sys.executable, script, "--rcfile=" + rcfile, "--"] + source_files, env=python_env(), shell=False, quiet=True)
def yapf(): script = os.path.join(third_party_path, "python_packages", "bin", "yapf") source_files = get_sources(root_path, ["*.py"]) if source_files: print_command("yapf", source_files) run([sys.executable, script, "-i", "--style=pep8", "--"] + source_files, env=python_env(), shell=False, quiet=True)
def pylint(): script = os.path.join(third_party_path, "python_packages", "pylint") rcfile = os.path.join(root_path, "tools", "pylintrc") msg_template = "{path}({line}:{column}) {category}: {msg} ({symbol})" source_files = get_sources(root_path, ["*.py"]) if source_files: print_command("pylint", source_files) run([ sys.executable, script, "--rcfile=" + rcfile, "--msg-template=" + msg_template, "--" ] + source_files, env=python_env(), shell=False, quiet=True)
def cpplint(): print "cpplint" script = os.path.join(third_party_path, "cpplint", "cpplint.py") source_files = git_ls_files(libdeno_path, ["*.cc", "*.h"]) run([ sys.executable, script, "--quiet", "--filter=-build/include_subdir", "--repository=" + libdeno_path, "--", ] + source_files, env=python_env(), shell=False, quiet=True)
# Does google-lint on c++ files and ts-lint on typescript files import os import sys from util import enable_ansi_colors, find_exts, root_path, run from third_party import python_env enable_ansi_colors() third_party_path = os.path.join(root_path, "third_party") cpplint = os.path.join(third_party_path, "cpplint", "cpplint.py") eslint = os.path.join(third_party_path, "node_modules", "eslint", "bin", "eslint") os.chdir(root_path) run([ "python", cpplint, "--filter=-build/include_subdir", "--repository=core/libdeno", "--extensions=cc,h", "--recursive", "core" ]) run([ "node", eslint, "--max-warnings=0", "./js/**/*.{ts,js}", "./core/**/*.{ts,js}", "./tests/**/*.{ts,js}" ]) run([ sys.executable, "third_party/python_packages/pylint", "--rcfile=third_party/depot_tools/pylintrc" ] + find_exts(["tools", "build_extra"], [".py"], skip=["tools/clang"]), env=python_env())
run(cmd, quiet=True, env=env) print "clang_format" qrun([clang_format_path, "-i", "-style", "Google"] + find_exts(["libdeno"], [".cc", ".h"])) print "gn format" for fn in ["BUILD.gn", ".gn"] + find_exts(["build_extra", "libdeno"], [".gn", ".gni"]): qrun(["third_party/depot_tools/gn", "format", fn], env=google_env()) print "yapf" qrun( [sys.executable, "third_party/python_packages/bin/yapf", "-i"] + find_exts( ["tools", "build_extra"], [".py"], skip=["tools/clang"]), env=python_env()) print "prettier" qrun(["node", prettier, "--write", "--loglevel=error"] + ["rollup.config.js"] + glob("*.json") + glob("*.md") + find_exts([".github", "js", "tests", "tools", "website", "core"], [".js", ".json", ".ts", ".md"], skip=["tools/clang", "js/deps"])) print "rustfmt" qrun([ "third_party/rustfmt/" + platform() + "/rustfmt", "--config-path", rustfmt_config, "build.rs" ] + find_exts(["src", "core"], [".rs"]))