tools/format: format markdown files with prettier

This commit is contained in:
Bert Belder 2018-10-04 00:58:28 -07:00
parent 30acfdf331
commit 8ca082c508
No known key found for this signature in database
GPG key ID: 7A77887B2E2ED461
3 changed files with 20 additions and 7 deletions

View file

@ -28,9 +28,14 @@ for fn in ["BUILD.gn", ".gn"] + find_exts("build_extra", ".gn", ".gni"):
# TODO(ry) Install yapf in third_party.
run(["yapf", "-i"] + glob("tools/*.py") + find_exts("build_extra", ".py"))
run(["node", prettier, "--write"] + find_exts("js/", ".js", ".ts") +
find_exts("tests/", ".js", ".ts") + find_exts("website/", ".js", ".ts") +
["rollup.config.js", "tsconfig.json", "tslint.json"])
# yapf: disable
run(["node", prettier, "--write"] +
["rollup.config.js"] + glob("*.json") + glob("*.md") +
find_exts(".github/", ".md") +
find_exts("js/", ".js", ".ts", ".md") +
find_exts("tests/", ".js", ".ts", ".md") +
find_exts("website/", ".js", ".ts", ".md"))
# yapf: enable
# Requires rustfmt 0.8.2 (flags were different in previous versions)
run(["rustfmt", "--config-path", rustfmt_config] + find_exts("src/", ".rs"))