Skip to content

Commit

Permalink
check formatting and regressions (#647)
Browse files Browse the repository at this point in the history
* ci: check formatting and regressions

* style: format Cargo manifests

* taplo: ignore more stuff, preserve style
  • Loading branch information
panekj authored Aug 16, 2024
1 parent 116ec57 commit 606571d
Show file tree
Hide file tree
Showing 3 changed files with 37 additions and 8 deletions.
16 changes: 14 additions & 2 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,15 @@ jobs:
email: [email protected]
token: ${{ secrets.WORKFLOW_PAT }}

fmt:
name: Check formatting
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: docker://docker.io/tamasfe/taplo:latest
with:
args: fmt --check --diff

test:
name: Test on Rust stable
runs-on: ubuntu-latest
Expand All @@ -40,8 +49,11 @@ jobs:
run: rustup update --no-self-update
- uses: Swatinem/rust-cache@v2
- name: Test Taplo
run: |
cargo test -p taplo
run: cargo test -p taplo
- name: Check formatting regression
run: cargo run -- fmt --check
- name: Check if git index is clean
run: git diff-index --quiet HEAD --

check_wasm32:
name: Check on WASM
Expand Down
4 changes: 2 additions & 2 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,9 @@ arc-swap = { version = "1.5.0" }
async-trait = { version = "0.1.52" }
either = { version = "1.6.1" }
futures = { version = "0.3.5" }
getrandom = { version = "0.2", default-features = false }
glob = { version = "0.3" }
globset = { version = "0.4.8" }
getrandom = { version = "0.2", default-features = false }
hex = { version = "0.4" }
indexmap = { version = "2.2" }
itertools = { version = "0.10.3" }
Expand All @@ -37,8 +37,8 @@ sha1 = { version = "0.10.5" }
tap = { version = "1.0.1" }
thiserror = { version = "1.0.30" }
time = { version = "0.3.7" }
toml = { version = "0.7" }
tokio = { version = "1.24.2", default-features = false }
toml = { version = "0.7" }
tracing = { version = "0.1.30" }
tracing-subscriber = { version = "0.3.7" }
url = { version = "2.2.2" }
Expand Down
25 changes: 21 additions & 4 deletions taplo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,27 @@ exclude = [
"**/*nested-1000.toml",
"**/node_modules/**",
"**/invalid/*",
"test-data/analytics/**",
"test-data/**",
]

[formatting]

[[rule]]

[rule.formatting]
include = ["taplo.toml"]
keys = ["exclude"]

array_auto_collapse = false

[[rule]]

[rule.formatting]
include = ["**/Cargo.toml"]

array_auto_expand = false
inline_table_expand = false

[[rule]]

[rule.formatting]
Expand All @@ -16,9 +34,8 @@ include = ["**/Cargo.toml"]
keys = ["dependencies", "*-dependencies", "workspace"]

[rule.formatting]
reorder_keys = true
align_comments = true
array_auto_expand = false
reorder_keys = true
align_comments = true

[[rule]]
include = ["**/Cargo.toml"]
Expand Down

0 comments on commit 606571d

Please sign in to comment.