From 5bb3d7c114afde0c4f98084d9fef2367abef482c Mon Sep 17 00:00:00 2001 From: Damien Elmes Date: Thu, 12 Nov 2020 20:11:40 +1000 Subject: [PATCH] format_fix -> format; rename svelte-check for consistency --- docs/development.md | 18 ++++++++++++------ pylib/BUILD.bazel | 4 ++-- pylib/rsbridge/BUILD.bazel | 4 ++-- qt/BUILD.bazel | 4 ++-- qt/aqt/data/web/js/BUILD.bazel | 2 +- rslib/BUILD.bazel | 4 ++-- ts/congrats/BUILD.bazel | 4 ++-- ts/graphs/BUILD.bazel | 4 ++-- ts/lib/BUILD.bazel | 2 +- 9 files changed, 26 insertions(+), 20 deletions(-) diff --git a/docs/development.md b/docs/development.md index 10b175182..56cc39bdb 100644 --- a/docs/development.md +++ b/docs/development.md @@ -60,14 +60,20 @@ bazel test //... ## Fixing formatting -If the format tests fail, most can be fixed by running format_fix -in the relevant folder: +If the format tests fail, most can be fixed by running `format` +in the relevant package: ``` -bazel run //rslib:format_fix -bazel run //pylib:format_fix -bazel run //pylib/rsbridge:format_fix -bazel run //qt:format_fix +bazel run //rslib:format +bazel run //pylib:format +bazel run //pylib/rsbridge:format +bazel run //qt:format +``` + +If you're in one of those folders, you can use the short form: + +``` +bazel run format ``` Currently the typescript code needs to be formatted differently: diff --git a/pylib/BUILD.bazel b/pylib/BUILD.bazel index c1a3ab618..f496c69a2 100644 --- a/pylib/BUILD.bazel +++ b/pylib/BUILD.bazel @@ -47,7 +47,7 @@ py_test( ) py_test( - name = "format", + name = "format_check", srcs = [ "//pylib/tools:py_source_files", "//pylib/anki:py_source_files", @@ -66,7 +66,7 @@ py_test( ) py_binary( - name = "format_fix", + name = "format", srcs = [ "tests/run_format.py", ], diff --git a/pylib/rsbridge/BUILD.bazel b/pylib/rsbridge/BUILD.bazel index 448b3d3e4..6bafa4d8c 100644 --- a/pylib/rsbridge/BUILD.bazel +++ b/pylib/rsbridge/BUILD.bazel @@ -33,14 +33,14 @@ rust_library( ) rustfmt_test( - name = "format", + name = "format_check", srcs = glob([ "*.rs", ]), ) rustfmt_fix( - name = "format_fix", + name = "format", srcs = glob([ "*.rs", ]), diff --git a/qt/BUILD.bazel b/qt/BUILD.bazel index c18d2b911..a526dc263 100644 --- a/qt/BUILD.bazel +++ b/qt/BUILD.bazel @@ -82,7 +82,7 @@ py_test( ) py_test( - name = "format", + name = "format_check", srcs = glob([ "**/*.py", ]), @@ -99,7 +99,7 @@ py_test( ) py_binary( - name = "format_fix", + name = "format", srcs = [ "tests/run_format.py", ], diff --git a/qt/aqt/data/web/js/BUILD.bazel b/qt/aqt/data/web/js/BUILD.bazel index 43bb9738a..8cdc09d22 100644 --- a/qt/aqt/data/web/js/BUILD.bazel +++ b/qt/aqt/data/web/js/BUILD.bazel @@ -42,7 +42,7 @@ filegroup( ) prettier_test( - name = "format", + name = "format_check", srcs = glob(["*.ts"]), ) diff --git a/rslib/BUILD.bazel b/rslib/BUILD.bazel index e4981f578..fa63e2d3f 100644 --- a/rslib/BUILD.bazel +++ b/rslib/BUILD.bazel @@ -134,14 +134,14 @@ rust_test( ) rustfmt_test( - name = "format", + name = "format_check", srcs = glob([ "src/**/*.rs", ]), ) rustfmt_fix( - name = "format_fix", + name = "format", srcs = glob([ "src/**/*.rs", ]), diff --git a/ts/congrats/BUILD.bazel b/ts/congrats/BUILD.bazel index a5cf7206a..0bba08881 100644 --- a/ts/congrats/BUILD.bazel +++ b/ts/congrats/BUILD.bazel @@ -57,7 +57,7 @@ exports_files(["congrats.html"]) ################ prettier_test( - name = "format", + name = "format_check", srcs = glob([ "*.ts", "*.svelte", @@ -72,7 +72,7 @@ eslint_test( ) svelte_check( - name = "svelte-check", + name = "svelte_check", srcs = glob([ "*.ts", "*.svelte", diff --git a/ts/graphs/BUILD.bazel b/ts/graphs/BUILD.bazel index 488027b3d..91bc5ae21 100644 --- a/ts/graphs/BUILD.bazel +++ b/ts/graphs/BUILD.bazel @@ -99,7 +99,7 @@ exports_files(["graphs.html"]) ################ prettier_test( - name = "format", + name = "format_check", srcs = glob([ "*.ts", "*.svelte", @@ -117,7 +117,7 @@ eslint_test( ) svelte_check( - name = "svelte-check", + name = "svelte_check", srcs = glob([ "*.ts", "*.svelte", diff --git a/ts/lib/BUILD.bazel b/ts/lib/BUILD.bazel index 6d1717998..ce841105b 100644 --- a/ts/lib/BUILD.bazel +++ b/ts/lib/BUILD.bazel @@ -51,7 +51,7 @@ filegroup( ################ prettier_test( - name = "format", + name = "format_check", srcs = glob(["*.ts"]), )