From 1a308269818bcab8d3a146f8286c0a6b665540b4 Mon Sep 17 00:00:00 2001 From: ThatCrispyToast <61917048+ThatCrispyToast@users.noreply.github.com> Date: Mon, 16 Feb 2026 06:13:05 -0500 Subject: [PATCH] fix: add distro agnostic shebang and clang-format check to `clang-format-fix` (#840) ## Summary **What is the goal of this PR?** (e.g., Implements the new feature for file uploading.) Minor development tooling fix for nonstandard environments (NixOS, FreeBSD, Guix, etc.) **What changes are included?** - environment relative shebang in `clang-format-fix` - clang-format check in `clang-format-fix` --- ### AI Usage While CrossPoint doesn't have restrictions on AI tools in contributing, please be transparent about their usage as it helps set the right context for reviewers. Did you use AI tools to help write this code? _**NO**_ --- bin/clang-format-fix | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/bin/clang-format-fix b/bin/clang-format-fix index 206cb217..157fcdd3 100755 --- a/bin/clang-format-fix +++ b/bin/clang-format-fix @@ -1,10 +1,18 @@ -#!/bin/bash +#!/usr/bin/env bash + +# Check if clang-format is availible +command -v clang-format >/dev/null 2>&1 || { + printf "'clang-format' not found in current environment\n" + printf "install 'clang', 'clang-tools', or 'clang-format' depending on your distro/os and tooling requirements\n" + exit 1 +} GIT_LS_FILES_FLAGS="" if [[ "$1" == "-g" ]]; then GIT_LS_FILES_FLAGS="--modified" fi + # --- Main Logic --- # Format all files (or only modified files if -g is passed)