From 1c3587347f17ecca63e1452ed3af74e6321e34e2 Mon Sep 17 00:00:00 2001 From: Bradley Axen Date: Sat, 7 Feb 2026 17:27:06 -0800 Subject: [PATCH 1/2] move lefthook to top level --- .../.just-1.46.0.pkg | 0 bin/.lefthook-2.0.15.pkg | 1 + bin/README.hermit.md | 7 +++ bin/activate-hermit | 21 +++++++++ bin/activate-hermit.fish | 24 +++++++++++ bin/hermit | 43 +++++++++++++++++++ bin/hermit.hcl | 2 + bin/just | 1 + {staged/bin => bin}/lefthook | 0 justfile | 10 +++++ staged/lefthook.yml => lefthook.yml | 10 +++-- staged/justfile | 3 +- 12 files changed, 117 insertions(+), 5 deletions(-) rename staged/bin/.lefthook-2.0.15.pkg => bin/.just-1.46.0.pkg (100%) create mode 120000 bin/.lefthook-2.0.15.pkg create mode 100644 bin/README.hermit.md create mode 100755 bin/activate-hermit create mode 100755 bin/activate-hermit.fish create mode 100755 bin/hermit create mode 100644 bin/hermit.hcl create mode 120000 bin/just rename {staged/bin => bin}/lefthook (100%) create mode 100644 justfile rename staged/lefthook.yml => lefthook.yml (55%) diff --git a/staged/bin/.lefthook-2.0.15.pkg b/bin/.just-1.46.0.pkg similarity index 100% rename from staged/bin/.lefthook-2.0.15.pkg rename to bin/.just-1.46.0.pkg diff --git a/bin/.lefthook-2.0.15.pkg b/bin/.lefthook-2.0.15.pkg new file mode 120000 index 0000000..383f451 --- /dev/null +++ b/bin/.lefthook-2.0.15.pkg @@ -0,0 +1 @@ +hermit \ No newline at end of file diff --git a/bin/README.hermit.md b/bin/README.hermit.md new file mode 100644 index 0000000..e889550 --- /dev/null +++ b/bin/README.hermit.md @@ -0,0 +1,7 @@ +# Hermit environment + +This is a [Hermit](https://github.com/cashapp/hermit) bin directory. + +The symlinks in this directory are managed by Hermit and will automatically +download and install Hermit itself as well as packages. These packages are +local to this environment. diff --git a/bin/activate-hermit b/bin/activate-hermit new file mode 100755 index 0000000..fe28214 --- /dev/null +++ b/bin/activate-hermit @@ -0,0 +1,21 @@ +#!/bin/bash +# This file must be used with "source bin/activate-hermit" from bash or zsh. +# You cannot run it directly +# +# THIS FILE IS GENERATED; DO NOT MODIFY + +if [ "${BASH_SOURCE-}" = "$0" ]; then + echo "You must source this script: \$ source $0" >&2 + exit 33 +fi + +BIN_DIR="$(dirname "${BASH_SOURCE[0]:-${(%):-%x}}")" +if "${BIN_DIR}/hermit" noop > /dev/null; then + eval "$("${BIN_DIR}/hermit" activate "${BIN_DIR}/..")" + + if [ -n "${BASH-}" ] || [ -n "${ZSH_VERSION-}" ]; then + hash -r 2>/dev/null + fi + + echo "Hermit environment $("${HERMIT_ENV}"/bin/hermit env HERMIT_ENV) activated" +fi diff --git a/bin/activate-hermit.fish b/bin/activate-hermit.fish new file mode 100755 index 0000000..0367d23 --- /dev/null +++ b/bin/activate-hermit.fish @@ -0,0 +1,24 @@ +#!/usr/bin/env fish + +# This file must be sourced with "source bin/activate-hermit.fish" from Fish shell. +# You cannot run it directly. +# +# THIS FILE IS GENERATED; DO NOT MODIFY + +if status is-interactive + set BIN_DIR (dirname (status --current-filename)) + + if "$BIN_DIR/hermit" noop > /dev/null + # Source the activation script generated by Hermit + "$BIN_DIR/hermit" activate "$BIN_DIR/.." | source + + # Clear the command cache if applicable + functions -c > /dev/null 2>&1 + + # Display activation message + echo "Hermit environment $($HERMIT_ENV/bin/hermit env HERMIT_ENV) activated" + end +else + echo "You must source this script: source $argv[0]" >&2 + exit 33 +end diff --git a/bin/hermit b/bin/hermit new file mode 100755 index 0000000..87acaad --- /dev/null +++ b/bin/hermit @@ -0,0 +1,43 @@ +#!/bin/bash +# +# THIS FILE IS GENERATED; DO NOT MODIFY + +set -eo pipefail + +export HERMIT_USER_HOME=~ + +if [ -z "${HERMIT_STATE_DIR}" ]; then + case "$(uname -s)" in + Darwin) + export HERMIT_STATE_DIR="${HERMIT_USER_HOME}/Library/Caches/hermit" + ;; + Linux) + export HERMIT_STATE_DIR="${XDG_CACHE_HOME:-${HERMIT_USER_HOME}/.cache}/hermit" + ;; + esac +fi + +export HERMIT_DIST_URL="${HERMIT_DIST_URL:-https://d1abdrezunyhdp.cloudfront.net/square}" +HERMIT_CHANNEL="$(basename "${HERMIT_DIST_URL}")" +export HERMIT_CHANNEL +export HERMIT_EXE=${HERMIT_EXE:-${HERMIT_STATE_DIR}/pkg/hermit@${HERMIT_CHANNEL}/hermit} + +if [ ! -x "${HERMIT_EXE}" ]; then + echo "Bootstrapping ${HERMIT_EXE} from ${HERMIT_DIST_URL}" 1>&2 + INSTALL_SCRIPT="$(mktemp)" + # This value must match that of the install script + INSTALL_SCRIPT_SHA256="4b006236f2e5e81939229b377bb355e3608f94d73ff8feccbd5792d1ed5699cd" + if [ "${INSTALL_SCRIPT_SHA256}" = "BYPASS" ]; then + curl -fsSL "${HERMIT_DIST_URL}/install.sh" -o "${INSTALL_SCRIPT}" + else + # Install script is versioned by its sha256sum value + curl -fsSL "${HERMIT_DIST_URL}/install-${INSTALL_SCRIPT_SHA256}.sh" -o "${INSTALL_SCRIPT}" + # Verify install script's sha256sum + openssl dgst -sha256 "${INSTALL_SCRIPT}" | \ + awk -v EXPECTED="$INSTALL_SCRIPT_SHA256" \ + '$2!=EXPECTED {print "Install script sha256 " $2 " does not match " EXPECTED; exit 1}' + fi + /bin/bash "${INSTALL_SCRIPT}" 1>&2 +fi + +exec "${HERMIT_EXE}" --level=fatal exec "$0" -- "$@" diff --git a/bin/hermit.hcl b/bin/hermit.hcl new file mode 100644 index 0000000..081cbe8 --- /dev/null +++ b/bin/hermit.hcl @@ -0,0 +1,2 @@ +github-token-auth { +} diff --git a/bin/just b/bin/just new file mode 120000 index 0000000..816066f --- /dev/null +++ b/bin/just @@ -0,0 +1 @@ +.just-1.46.0.pkg \ No newline at end of file diff --git a/staged/bin/lefthook b/bin/lefthook similarity index 100% rename from staged/bin/lefthook rename to bin/lefthook diff --git a/justfile b/justfile new file mode 100644 index 0000000..e891888 --- /dev/null +++ b/justfile @@ -0,0 +1,10 @@ +# Builderbot Monorepo +# Run `just setup` once after cloning to install git hooks. + +# ============================================================================ +# Setup +# ============================================================================ + +# First-time setup: install git hooks (run once at repo root) +setup: + lefthook install diff --git a/staged/lefthook.yml b/lefthook.yml similarity index 55% rename from staged/lefthook.yml rename to lefthook.yml index 0c6df08..fda42a2 100644 --- a/staged/lefthook.yml +++ b/lefthook.yml @@ -2,12 +2,16 @@ skip_lfs: true output: - success - failure + pre-push: parallel: true commands: - fmt-check: + staged-fmt-check: + root: "staged/" run: just fmt-check - lint: + staged-lint: + root: "staged/" run: just lint - typecheck: + staged-typecheck: + root: "staged/" run: just typecheck diff --git a/staged/justfile b/staged/justfile index a19fff5..15285b7 100644 --- a/staged/justfile +++ b/staged/justfile @@ -74,11 +74,10 @@ ci: fmt-check lint typecheck # Setup & Maintenance # ============================================================================ -# First-time setup: install all dependencies and git hooks +# First-time setup: install all dependencies install: npm install cd src-tauri && cargo fetch - lefthook install # Delete all build artifacts and dependencies clean: From ec4eaba3d4837650f70e754db3738e21771fa7a1 Mon Sep 17 00:00:00 2001 From: Bradley Axen Date: Sat, 7 Feb 2026 17:28:53 -0800 Subject: [PATCH 2/2] auto fix --- lefthook.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lefthook.yml b/lefthook.yml index fda42a2..5f1649b 100644 --- a/lefthook.yml +++ b/lefthook.yml @@ -6,9 +6,9 @@ output: pre-push: parallel: true commands: - staged-fmt-check: + staged-fmt: root: "staged/" - run: just fmt-check + run: just fmt staged-lint: root: "staged/" run: just lint