1
0
Fork 0
mirror of https://github.com/denoland/deno.git synced 2024-12-01 16:51:13 -05:00

fix(tools/lint): don't exceed max command line length on windows (#6804)

This commit is contained in:
木杉 2020-07-21 22:47:55 +08:00 committed by GitHub
parent 2460689b1a
commit f34a441a7d
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -71,15 +71,24 @@ def eslint():
":!:cli/tests/lint/**", ":!:cli/tests/lint/**",
]) ])
if source_files: if source_files:
print_command("eslint", source_files) max_command_len = 30000
# Set NODE_PATH so we don't have to maintain a symlink in root_path. pre_command = ["node", script, "--max-warnings=0", "--"]
env = os.environ.copy() chunks = [[]]
env["NODE_PATH"] = os.path.join(root_path, "third_party", cmd_len = len(" ".join(pre_command))
"node_modules") for f in source_files:
run(["node", script, "--max-warnings=0", "--"] + source_files, if cmd_len + len(f) > max_command_len:
shell=False, chunks.append([f])
env=env, cmd_len = len(" ".join(pre_command))
quiet=True) else:
chunks[-1].append(f)
cmd_len = cmd_len + len(f) + 1
for c in chunks:
print_command("eslint", c)
# Set NODE_PATH so we don't have to maintain a symlink in root_path.
env = os.environ.copy()
env["NODE_PATH"] = os.path.join(root_path, "third_party",
"node_modules")
run(pre_command + c, shell=False, env=env, quiet=True)
def pylint(): def pylint():