the runtime your coding agents live on
Rust agentagent-orchestrationaiai-agentsclaude-codeclicodexcoding-agentsdeveloper-toolsdevtoolsmultiplexerrustterminalterminal-multiplexerterminal-uitmuxtuiworkspace-manager
chore: add pre-commit fmt hook
Ogulcan Celikd96962adf623
diff --git a/.githooks/pre-commit b/.githooks/pre-commitnew file mode 100755index 000000000..249d41f7f--- /dev/null+++ b/.githooks/pre-commit@@ -0,0 +1,8 @@+#!/usr/bin/env bash+set -euo pipefail++repo_root="$(git rev-parse --show-toplevel)"+cd "$repo_root"++echo "pre-commit: running cargo fmt --check"+cargo fmt --checkdiff --git a/CONTRIBUTING.md b/CONTRIBUTING.mdindex 5a4784d5b..42a08593c 100644--- a/CONTRIBUTING.md+++ b/CONTRIBUTING.md@@ -48,6 +48,14 @@ If you plan to implement the change yourself, say that directly in the issue and## Before submitting a PR+Install the repo hook once in your clone.++```bash+just install-hooks+```++The pre-commit hook runs `cargo fmt --check` before every commit.+Run the PR checks and make sure they pass.```bashdiff --git a/justfile b/justfileindex 4dd729c41..3232568b8 100644--- a/justfile+++ b/justfile@@ -14,6 +14,12 @@ ci:check: cipython3 -m unittest scripts.test_changelog scripts.test_vendor_libghostty_vt+# Install repo-local git hooks+install-hooks:+ git config core.hooksPath .githooks+ chmod +x .githooks/pre-commit+ @echo "installed git hooks from .githooks"+# Build release binarybuild:cargo build --releasediff --git a/tests/cli_wrapper.rs b/tests/cli_wrapper.rsindex 9da110613..8c8574d3a 100644--- a/tests/cli_wrapper.rs+++ b/tests/cli_wrapper.rs@@ -396,8 +396,17 @@ fn pane_close_only_removes_the_target_tab_when_other_tabs_exist() {let workspaces = run_cli(&socket_path, &["workspace", "list"]);assert!(workspaces.status.success());let workspaces_json: serde_json::Value = serde_json::from_slice(&workspaces.stdout).unwrap();- assert_eq!(workspaces_json["result"]["workspaces"].as_array().unwrap().len(), 1);- assert_eq!(workspaces_json["result"]["workspaces"][0]["workspace_id"], workspace_id);+ assert_eq!(+ workspaces_json["result"]["workspaces"]+ .as_array()+ .unwrap()+ .len(),+ 1+ );+ assert_eq!(+ workspaces_json["result"]["workspaces"][0]["workspace_id"],+ workspace_id+ );let tabs = run_cli(&socket_path, &["tab", "list", "--workspace", &workspace_id]);assert!(tabs.status.success());@@ -436,7 +445,10 @@ fn pane_close_removes_the_workspace_when_it_closes_the_last_pane() {let workspaces = run_cli(&socket_path, &["workspace", "list"]);assert!(workspaces.status.success());let workspaces_json: serde_json::Value = serde_json::from_slice(&workspaces.stdout).unwrap();- assert!(workspaces_json["result"]["workspaces"].as_array().unwrap().is_empty());+ assert!(workspaces_json["result"]["workspaces"]+ .as_array()+ .unwrap()+ .is_empty());cleanup_spawned_herdr(herdr, base);}