Skip to content

Commit f4be27f

Browse files
committed
chore: lint TOML
1 parent 1e4a59a commit f4be27f

File tree

4 files changed

+36
-2
lines changed

4 files changed

+36
-2
lines changed

.github/workflows/ci.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,9 @@ jobs:
2828
with:
2929
tool: cargo-deny,just
3030

31+
- name: Install `tombi`
32+
uses: tombi-toml/setup-tombi@a9378ac9fe5c29df7d26263deacea4ac642af9c2 # v1
33+
3134
- name: Install stable toolchain
3235
uses: dtolnay/rust-toolchain@e97e2d8cc328f1b50210efc529dca0028893a2d9 # master
3336
with:

CONTRIBUTING.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,9 @@ Install [just] to easily run all the tests/scripts.
2525
### Python
2626
Install [Python] to set up the environment for the [Python] guest.
2727

28+
### Tombi
29+
Install [tombi] to format and lint [TOML] files.
30+
2831

2932
## Checks
3033
There is one "run everything" [just] recipe:
@@ -107,4 +110,6 @@ Then the [Python Standard Library] was not found or not bundled correctly. You m
107110
[Python Standard Library]: https://docs.python.org/3/library/index.html
108111
[Rust]: https://www.rust-lang.org/
109112
[rustup]: https://rustup.rs/
113+
[tombi]: https://tombi-toml.github.io/tombi
114+
[TOML]: https://toml.io/
110115
[yamllint]: https://github.com/adrienverge/yamllint

Justfile

Lines changed: 26 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -52,14 +52,29 @@ check-rust-deny:
5252
# run ALL Rust checks
5353
check-rust: check-rust-fmt check-rust-check check-rust-build check-rust-clippy check-rust-test check-rust-doc check-rust-bench check-rust-deny
5454

55+
# check TOML formatting
56+
check-toml-fmt:
57+
@echo ::group::check-toml-fmt
58+
tombi format --check
59+
@echo ::endgroup::
60+
61+
# lint TOML files with taplo
62+
check-toml-lint:
63+
@echo ::group::check-toml-lint
64+
tombi lint
65+
@echo ::endgroup::
66+
67+
# check TOML files
68+
check-toml: check-toml-fmt check-toml-lint
69+
5570
# lint YAML files
5671
check-yaml:
5772
@echo ::group::check-yaml
5873
yamllint -s .
5974
@echo ::endgroup::
6075

6176
# run ALL checks
62-
check: check-rust check-yaml
77+
check: check-rust check-toml check-yaml
6378

6479
# clean Rust build artifacts
6580
clean-rust:
@@ -91,5 +106,14 @@ fix-rust-fmt:
91106
# fix common Rust issues automatically
92107
fix-rust: fix-rust-clippy fix-rust-check fix-rust-fmt
93108

109+
# fix TOML formatting
110+
fix-toml-fmt:
111+
@echo ::group::fix-toml-fmt
112+
tombi format
113+
@echo ::endgroup::
114+
115+
# fix common TOML issues
116+
fix-toml: fix-toml-fmt
117+
94118
# fix common issues automatically
95-
fix: fix-rust
119+
fix: fix-rust fix-toml

tombi.toml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
[files]
2+
exclude = [".jj/**/*.toml", "target/**/*.toml"]

0 commit comments

Comments
 (0)