Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
**/target/
node_modules/
28 changes: 28 additions & 0 deletions .husky/commit-msg
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@

# Husky v10: no shebang, no husky.sh

CONFIG=".github/.commitlintrc.yml"
MSG_FILE="$1"

echo "👉 Running Commitlint check..."

# Check if commitlint is installed via npm
if npx --no-install commitlint --version >/dev/null 2>&1; then
# Config file check
if [ -f "$CONFIG" ]; then
npx --no-install commitlint --config "$CONFIG" --edit "$MSG_FILE"
else
echo "❌ Commitlint config not found at: $CONFIG"
echo " Please ensure this file exists before committing."
exit 1
fi
else
echo "❌ Commitlint CLI not found (required)."
echo " Install it with:"
echo " npm install -D @commitlint/cli @commitlint/config-conventional"
echo " Commit aborted until Commitlint is installed."
exit 1
fi

echo "✅ Commitlint check passed."

49 changes: 49 additions & 0 deletions .husky/pre-commit
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
# Husky v10+: no shebang, no sourcing, POSIX-sh safe
set -e

# --- REUSE at repository root (strict check first) ---
if ! command -v reuse >/dev/null 2>&1; then
echo "❌ REUSE tool is required but not installed."
echo " Install it with: pip install reuse OR pipx install reuse"
exit 1
fi

echo "📜 REUSE license compliance (repo root)..."
if ! reuse lint; then
echo "❌ REUSE license compliance failed."
exit 1
fi

# --- Rust checks inside firmware directory ---
(
cd firmware || {
echo "⚠️ 'firmware' directory not found."
exit 1
}

echo "🔍 Checking code formatting (cargo fmt)..."
if ! cargo fmt --all -- --check; then
echo "❌ Code formatting issues detected. Run: cargo fmt --all"
exit 1
fi

echo "🧠 Running Clippy (RP2040 target)..."
if ! cargo clippy --target thumbv6m-none-eabi -- -D warnings; then
echo "❌ Clippy failed with warnings/errors."
exit 1
fi

echo "🏗️ Building (release, RP2040 target)..."
if ! cargo build --release --target thumbv6m-none-eabi; then
echo "❌ Build failed."
exit 1
fi

echo "✅ cargo check (RP2040 target)..."
if ! cargo check --target thumbv6m-none-eabi; then
echo "❌ cargo check failed."
exit 1
fi
)

echo "✅ All checks passed! Proceeding with commit..."
9 changes: 8 additions & 1 deletion REUSE.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,14 @@
version = 1

[[annotations]]
path = ["package.json", "CHANGELOG.md", ".gitignore", "docs/CNAME"]
path = [
"package.json",
"CHANGELOG.md",
".gitignore",
"docs/CNAME",
".husky/**",
"package-lock.json",
]
precedence = "aggregate"
SPDX-FileCopyrightText = "2025 hexaTune LLC"
SPDX-License-Identifier = "MIT"
Expand Down
Loading
Loading