mirror of
https://github.com/denoland/deno.git
synced 2025-09-27 04:39:10 +00:00
Wrap rust at 80 columns.
This commit is contained in:
parent
c67d98eb7f
commit
a7bf154cb8
5 changed files with 28 additions and 9 deletions
|
@ -8,6 +8,8 @@ root_path = os.path.dirname(os.path.dirname(os.path.realpath(__file__)))
|
|||
third_party_path = os.path.join(root_path, "third_party")
|
||||
prettier = os.path.join(third_party_path, "node_modules", "prettier",
|
||||
"bin-prettier.js")
|
||||
tools_path = os.path.join(root_path, "tools")
|
||||
rustfmt_config = os.path.join(tools_path, "rustfmt.toml")
|
||||
|
||||
os.chdir(root_path)
|
||||
# TODO(ry) Install clang-format in third_party.
|
||||
|
@ -24,5 +26,7 @@ run(["node", prettier, "--write"] + glob("js/*.js") + glob("js/*.ts") +
|
|||
rustfmt_extra_args = []
|
||||
if 'RUSTFMT_FLAGS' in os.environ:
|
||||
rustfmt_extra_args += os.environ['RUSTFMT_FLAGS'].split()
|
||||
run(["rustfmt", "--write-mode", "overwrite"] + rustfmt_extra_args +
|
||||
glob("src/*.rs"))
|
||||
run([
|
||||
"rustfmt", "--config-path", rustfmt_config, "--error-on-unformatted",
|
||||
"--write-mode", "overwrite"
|
||||
] + rustfmt_extra_args + glob("src/*.rs"))
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue