mirror of
https://github.com/ankitects/anki.git
synced 2025-09-19 06:22:22 -04:00
make 'bazel run ts:format' work
We're cheating a bit by having it fix files in qt's data folder as well, but this makes it easier to share the config file.
This commit is contained in:
parent
5bb3d7c114
commit
b71f55dcc5
5 changed files with 18 additions and 9 deletions
|
@ -66,8 +66,9 @@ in the relevant package:
|
||||||
```
|
```
|
||||||
bazel run //rslib:format
|
bazel run //rslib:format
|
||||||
bazel run //pylib:format
|
bazel run //pylib:format
|
||||||
bazel run //pylib/rsbridge:format
|
|
||||||
bazel run //qt:format
|
bazel run //qt:format
|
||||||
|
bazel run //ts:format
|
||||||
|
bazel run //pylib/rsbridge:format
|
||||||
```
|
```
|
||||||
|
|
||||||
If you're in one of those folders, you can use the short form:
|
If you're in one of those folders, you can use the short form:
|
||||||
|
@ -76,13 +77,6 @@ If you're in one of those folders, you can use the short form:
|
||||||
bazel run format
|
bazel run format
|
||||||
```
|
```
|
||||||
|
|
||||||
Currently the typescript code needs to be formatted differently:
|
|
||||||
|
|
||||||
```
|
|
||||||
cd ts
|
|
||||||
./node_modules/.bin/prettier --write .
|
|
||||||
```
|
|
||||||
|
|
||||||
## Building redistributable wheels
|
## Building redistributable wheels
|
||||||
|
|
||||||
```
|
```
|
||||||
|
|
|
@ -1 +1,3 @@
|
||||||
src/backend/proto.d.ts
|
src/backend/proto.d.ts
|
||||||
|
licenses.json
|
||||||
|
vendor
|
||||||
|
|
|
@ -1,3 +1,7 @@
|
||||||
|
load("//ts:prettier.bzl", "prettier")
|
||||||
|
|
||||||
|
prettier()
|
||||||
|
|
||||||
# Exported files
|
# Exported files
|
||||||
#################
|
#################
|
||||||
|
|
||||||
|
|
3
ts/format.sh
Executable file
3
ts/format.sh
Executable file
|
@ -0,0 +1,3 @@
|
||||||
|
# this is a hack to invoke prettier directly from Bazel
|
||||||
|
ts=${BUILD_WORKSPACE_DIRECTORY}/ts
|
||||||
|
(cd $ts && ./node_modules/.bin/prettier --config .prettierrc --write . $ts/../qt/aqt/data/web/js)
|
|
@ -3,7 +3,7 @@ load(
|
||||||
_prettier_test = "prettier_test",
|
_prettier_test = "prettier_test",
|
||||||
)
|
)
|
||||||
|
|
||||||
def prettier_test(name = "format", srcs = [], **kwargs):
|
def prettier_test(name = "format_check", srcs = [], **kwargs):
|
||||||
_prettier_test(
|
_prettier_test(
|
||||||
name = name,
|
name = name,
|
||||||
args = [
|
args = [
|
||||||
|
@ -17,3 +17,9 @@ def prettier_test(name = "format", srcs = [], **kwargs):
|
||||||
] + srcs,
|
] + srcs,
|
||||||
**kwargs
|
**kwargs
|
||||||
)
|
)
|
||||||
|
|
||||||
|
def prettier(name = "format", **kwargs):
|
||||||
|
native.sh_binary(
|
||||||
|
name = name,
|
||||||
|
srcs = ["format.sh"],
|
||||||
|
)
|
||||||
|
|
Loading…
Reference in a new issue