Wrap rust at 80 columns.

This commit is contained in:
Ryan Dahl 2018-07-19 21:06:48 -04:00
parent c67d98eb7f
commit a7bf154cb8
5 changed files with 28 additions and 9 deletions

View file

@ -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"))