From 8ca082c50898c62863e4baf04387bd37ce8328f8 Mon Sep 17 00:00:00 2001 From: Bert Belder Date: Thu, 4 Oct 2018 00:58:28 -0700 Subject: [PATCH] tools/format: format markdown files with prettier --- .prettierrc.json | 3 +++ README.md | 13 +++++++++---- tools/format.py | 11 ++++++++--- 3 files changed, 20 insertions(+), 7 deletions(-) create mode 100644 .prettierrc.json diff --git a/.prettierrc.json b/.prettierrc.json new file mode 100644 index 0000000000..5b5bd9933e --- /dev/null +++ b/.prettierrc.json @@ -0,0 +1,3 @@ +{ + "proseWrap": "always" +} diff --git a/README.md b/README.md index 3051d89217..1069081cc0 100644 --- a/README.md +++ b/README.md @@ -2,8 +2,7 @@ | **Linux & Mac** | **Windows** | |:---------------:|:-----------:| -| [![Travis](https://travis-ci.com/denoland/deno.svg?branch=master)](https://travis-ci.com/denoland/deno) | [![Appveyor](https://ci.appveyor.com/api/projects/status/yel7wtcqwoy0to8x?branch=master&svg=true)](https://ci.appveyor.com/project/deno/deno) | - +| [![][tci badge]][tci link] | [![][avy badge]][avy link] | ## A secure TypeScript runtime built on V8 @@ -32,7 +31,7 @@ network access. * Single executable: - ``` + ``` > ls -lh out/release/deno -rwxr-xr-x 1 rld staff 48M Aug 2 13:24 out/release/deno > otool -L out/release/deno @@ -42,7 +41,7 @@ /System/Library/Frameworks/Security.framework/Versions/A/Security (compatibility version 1.0.0, current version 58286.51.6) /usr/lib/libc++.1.dylib (compatibility version 1.0.0, current version 400.9.0) > - ``` + ``` * Always dies on uncaught errors. @@ -152,3 +151,9 @@ Env vars: `DENO_BUILD_MODE`, `DENO_BUILD_PATH`, `DENO_BUILD_ARGS`. 5. Make sure `./tools/lint.py` passes. 6. Send a pull request. 7. Sign the [CLA](https://cla-assistant.io/denoland/deno), if you haven't already. + + +[avy badge]: https://ci.appveyor.com/api/projects/status/yel7wtcqwoy0to8x?branch=master&svg=true +[avy link]: https://ci.appveyor.com/project/deno/deno +[tci badge]: https://travis-ci.com/denoland/deno.svg?branch=master +[tci link]: https://travis-ci.com/denoland/deno diff --git a/tools/format.py b/tools/format.py index b91e75635a..272f2c82b3 100755 --- a/tools/format.py +++ b/tools/format.py @@ -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"))