Skip to content

Commit b2a1eae

Browse files
bazel: run topiary formatter with rules_multitool
1 parent b9b9bb7 commit b2a1eae

File tree

3 files changed

+36
-0
lines changed

3 files changed

+36
-0
lines changed

.topiary/languages.ncl

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
{
2+
languages = {
3+
json = {
4+
extensions = [
5+
"json",
6+
],
7+
indent = " ",
8+
grammar.source.git = {
9+
git = "https://github.com/tree-sitter/tree-sitter-json.git",
10+
rev = "v0.24.8",
11+
nixHash = "sha256-DNZC2cTy1C8OaMOpEHM6NoRtOIbLaBf0CLXXWCKODlw=",
12+
},
13+
},
14+
}
15+
}

README.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -141,3 +141,11 @@ $ bazel build //:archive-lean
141141
$ tar -O -xf bazel-bin/archive.tar LICENSE
142142
$ tar -O -xf bazel-bin/archive-lean.tar LICENSE
143143
```
144+
145+
## Run topiary
146+
147+
The configuration file is picked up automatically from the `.topiary` directory.
148+
149+
```shell
150+
$ bazel run @multitool//tools/topiary:workspace_root -- format tools/multitool.lock.json
151+
```

tools/multitool.lock.json

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,5 +22,18 @@
2222
"cpu": "x86_64"
2323
}
2424
]
25+
},
26+
"topiary": {
27+
"binaries": [
28+
{
29+
"kind": "archive",
30+
"file": "topiary-cli-x86_64-unknown-linux-gnu/topiary",
31+
"type": "tar.xz",
32+
"url": "https://github.com/tweag/topiary/releases/download/v0.6.1/topiary-cli-x86_64-unknown-linux-gnu.tar.xz",
33+
"sha256": "0e92b430dfd3aa0cc5033579fd546f9df9a66117888ed526c61b95fe58b2c9a1",
34+
"os": "linux",
35+
"cpu": "x86_64"
36+
}
37+
]
2538
}
2639
}

0 commit comments

Comments
 (0)