From 0cf38b5defd09ce534a9df70fa046b8790877dcb Mon Sep 17 00:00:00 2001 From: extrawurst <776816+extrawurst@users.noreply.github.com> Date: Sat, 28 Mar 2026 21:02:05 +0100 Subject: [PATCH] use tombi for toml formatting (#2894) --- .github/workflows/ci.yml | 12 +++-- CHANGELOG.md | 3 ++ Makefile | 2 +- asyncgit/Cargo.toml | 10 ++-- deny.toml | 108 +++++++++++++++++++-------------------- filetreelist/Cargo.toml | 2 +- rustfmt.toml | 6 +-- scopetime/Cargo.toml | 8 +-- 8 files changed, 80 insertions(+), 71 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index f87853e0..e34dd840 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -253,10 +253,16 @@ jobs: - run: cargo fmt -- --check - - name: cargo-sort + - name: tombi install + uses: tombi-toml/setup-tombi@v1 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + with: + version: '0.9.0' + + - name: tombi check run: | - cargo install cargo-sort --force - cargo sort -c -w + tombi format --check - name: cargo-deny install run: | diff --git a/CHANGELOG.md b/CHANGELOG.md index ef6e3a53..c9272de5 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,6 +7,9 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## Unreleased +### Changed +* use [tombi](https://github.com/tombi-toml/tombi) for all toml file formatting + ### Fixes * when staging the last file in a directory, the first item after the directory is no longer skipped [[@Tillerino](https://github.com/Tillerino)] ([#2748](https://github.com/gitui-org/gitui/issues/2748)) diff --git a/Makefile b/Makefile index 4b0c5496..939c8118 100644 --- a/Makefile +++ b/Makefile @@ -105,7 +105,7 @@ deny: cargo deny check sort: - cargo sort -c -w "." + tombi format --check install: cargo install --path "." --offline --locked diff --git a/asyncgit/Cargo.toml b/asyncgit/Cargo.toml index 8863ba65..5e77498a 100644 --- a/asyncgit/Cargo.toml +++ b/asyncgit/Cargo.toml @@ -11,11 +11,6 @@ license = "MIT" categories = ["asynchronous", "concurrency"] keywords = ["git"] -[features] -default = ["trace-libgit"] -trace-libgit = [] -vendor-openssl = ["openssl-sys"] - [dependencies] bitflags = "2" crossbeam-channel = "0.5" @@ -50,3 +45,8 @@ invalidstring = { path = "../invalidstring", version = "0.1" } pretty_assertions = "1.4" serial_test = "3.3" tempfile = "3" + +[features] +default = ["trace-libgit"] +trace-libgit = [] +vendor-openssl = ["openssl-sys"] diff --git a/deny.toml b/deny.toml index bf993d40..7639adbe 100644 --- a/deny.toml +++ b/deny.toml @@ -1,67 +1,67 @@ [licenses] allow = [ - "MIT", - "Apache-2.0", - "BSD-2-Clause", - "BSD-3-Clause", - "CC0-1.0", - "ISC", - "MPL-2.0", - "Unicode-3.0", - "Zlib", + "MIT", + "Apache-2.0", + "BSD-2-Clause", + "BSD-3-Clause", + "CC0-1.0", + "ISC", + "MPL-2.0", + "Unicode-3.0", + "Zlib", ] [advisories] version = 2 ignore = [ - # No fix for RSA, and this is a dependency from ssh_key crate to handle rsa ssh key. - # https://rustsec.org/advisories/RUSTSEC-2023-0071 - "RUSTSEC-2023-0071", - # Crate paste is unmaintained. The dependency is already removed in - # ratatui:master. Until a new release is available, ignore this in - # order to pass CI. (https://github.com/gitui-org/gitui/issues/2554) - { id = "RUSTSEC-2024-0436", reason = "The paste dependency is already removed from ratatui." }, - # See https://github.com/trishume/syntect/issues/606 - { id = "RUSTSEC-2025-0141", reason = "Only brought in via syntect" }, + # No fix for RSA, and this is a dependency from ssh_key crate to handle rsa ssh key. + # https://rustsec.org/advisories/RUSTSEC-2023-0071 + "RUSTSEC-2023-0071", + # Crate paste is unmaintained. The dependency is already removed in + # ratatui:master. Until a new release is available, ignore this in + # order to pass CI. (https://github.com/gitui-org/gitui/issues/2554) + { id = "RUSTSEC-2024-0436", reason = "The paste dependency is already removed from ratatui." }, + # See https://github.com/trishume/syntect/issues/606 + { id = "RUSTSEC-2025-0141", reason = "Only brought in via syntect" }, ] [bans] multiple-versions = "deny" skip-tree = [ - # currently needed due to: - # * `dirs-sys v0.4.1` (https://github.com/dirs-dev/dirs-sys-rs/issues/29) - { name = "windows-sys" }, - # this is needed for: - # `bwrap v1.3.0` (https://github.com/micl2e2/bwrap/pull/4) - { name = "unicode-width" }, - # currently needed due to `ratatui v0.29.0` - { name = "unicode-truncate" }, - # currently needed due to: - # * `redox_users v0.4.6` - # * `syntect v5.2.0` - { name = "thiserror" }, - # currently needed due to: - # * `windows v0.57.0` - # * `iana-time-zone v0.1.60` - { name = "windows-core" }, - # currently needed due to: - # * `parking_lot_core v0.9.10` - # * `filetime v0.2.23` - { name = "redox_syscall" }, - # currently needed due to: - # * `gix-hashtable v0.6.0` - { name = "hashbrown" }, - # 2022-10-26 `getrandom` and `rustix` were added when `gitoxide` was - # upgraded from 0.71.0 to 0.74.1. - # currently needed due to: - # * `tempfile v3.23.0` - # * `rand_core v0.6.4` - # * `redox_users v0.5.0` - { name = "getrandom" }, - # currently needed due to: - # * `crossterm v0.28.1` - # * `which v7.0.2` - # * `gix-index v0.42.1` - # * `tempfile v3.23.0` - { name = "rustix" }, + # currently needed due to: + # * `dirs-sys v0.4.1` (https://github.com/dirs-dev/dirs-sys-rs/issues/29) + { name = "windows-sys" }, + # this is needed for: + # `bwrap v1.3.0` (https://github.com/micl2e2/bwrap/pull/4) + { name = "unicode-width" }, + # currently needed due to `ratatui v0.29.0` + { name = "unicode-truncate" }, + # currently needed due to: + # * `redox_users v0.4.6` + # * `syntect v5.2.0` + { name = "thiserror" }, + # currently needed due to: + # * `windows v0.57.0` + # * `iana-time-zone v0.1.60` + { name = "windows-core" }, + # currently needed due to: + # * `parking_lot_core v0.9.10` + # * `filetime v0.2.23` + { name = "redox_syscall" }, + # currently needed due to: + # * `gix-hashtable v0.6.0` + { name = "hashbrown" }, + # 2022-10-26 `getrandom` and `rustix` were added when `gitoxide` was + # upgraded from 0.71.0 to 0.74.1. + # currently needed due to: + # * `tempfile v3.23.0` + # * `rand_core v0.6.4` + # * `redox_users v0.5.0` + { name = "getrandom" }, + # currently needed due to: + # * `crossterm v0.28.1` + # * `which v7.0.2` + # * `gix-index v0.42.1` + # * `tempfile v3.23.0` + { name = "rustix" }, ] diff --git a/filetreelist/Cargo.toml b/filetreelist/Cargo.toml index f9687767..bc2b075e 100644 --- a/filetreelist/Cargo.toml +++ b/filetreelist/Cargo.toml @@ -9,7 +9,7 @@ repository = "https://github.com/gitui-org/gitui" readme = "README.md" license = "MIT" categories = ["command-line-utilities"] -keywords = ["gui", "cli", "terminal", "ui", "tui"] +keywords = ["cli", "gui", "terminal", "tui", "ui"] exclude = ["/demo.gif"] [dependencies] diff --git a/rustfmt.toml b/rustfmt.toml index aec36615..da5d80cd 100644 --- a/rustfmt.toml +++ b/rustfmt.toml @@ -1,3 +1,3 @@ -max_width=70 -hard_tabs=true -newline_style="Unix" \ No newline at end of file +max_width = 70 +hard_tabs = true +newline_style = "Unix" diff --git a/scopetime/Cargo.toml b/scopetime/Cargo.toml index 2cce308a..9343673c 100644 --- a/scopetime/Cargo.toml +++ b/scopetime/Cargo.toml @@ -9,11 +9,11 @@ repository = "https://github.com/gitui-org/gitui" license = "MIT" readme = "README.md" categories = ["development-tools::profiling"] -keywords = ["profiling", "logging"] +keywords = ["logging", "profiling"] + +[dependencies] +log = "0.4" [features] default = [] enabled = [] - -[dependencies] -log = "0.4"