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
4 changes: 2 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
*.swp
.buildlog/
.history

node_modules/


# Flutter repo-specific
Expand Down Expand Up @@ -116,4 +116,4 @@ app.*.symbols
!**/ios/**/default.pbxuser
!**/ios/**/default.perspectivev3
!/packages/flutter_tools/test/data/dart_dependencies_test/**/.packages
!/dev/ci/**/Gemfile.lock
!/dev/ci/**/Gemfile.lock
26 changes: 26 additions & 0 deletions .husky/commit-msg
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
# 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."
95 changes: 95 additions & 0 deletions .husky/pre-commit
Original file line number Diff line number Diff line change
@@ -0,0 +1,95 @@
# Husky v10+: no shebang, no sourcing, POSIX-sh safe
set -e

############################################
# 1) REUSE (repo root) — STRICT
############################################
if ! command -v reuse >/dev/null 2>&1; then
echo "❌ REUSE tool is required but not installed."
echo " Install: pipx install reuse OR python3 -m pip install --user reuse"
exit 1
fi

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

############################################
# 2) Flutter app checks in hexagenapp/
############################################
(
APP_DIR="hexagenapp"
if [ ! -d "$APP_DIR" ]; then
echo "❌ '$APP_DIR' directory not found."
exit 1
fi

cd "$APP_DIR"

# Tools required
if ! command -v flutter >/dev/null 2>&1; then
echo "❌ 'flutter' CLI not found (required)."
echo " Install Flutter: https://docs.flutter.dev/get-started/install"
exit 1
fi
if ! command -v dart >/dev/null 2>&1; then
echo "❌ 'dart' CLI not found (required)."
echo " Dart comes with Flutter; ensure Flutter SDK is on PATH."
exit 1
fi

echo "🔧 Ensuring pub deps..."
flutter pub get >/dev/null

echo "🔍 Dart formatting check..."
if ! dart format --output=none --set-exit-if-changed .; then
echo "❌ Dart formatting issues detected."
echo " Fix with: dart format ."
exit 1
fi

echo "🧠 Flutter analyze..."
if ! flutter analyze --no-pub; then
echo "❌ flutter analyze failed."
exit 1
fi

echo "🧪 Flutter tests..."
if ! flutter test --no-pub; then
echo "❌ flutter test failed."
exit 1
fi

# Optional build (opt-in to avoid heavy pre-commit)
if [ "${FLUTTER_PRECOMMIT_BUILD:-0}" = "1" ]; then
echo "🏗️ Optional build enabled (FLUTTER_PRECOMMIT_BUILD=1)..."
OS="$(uname -s || echo unknown)"

if [ "$OS" = "Darwin" ]; then
# macOS: try iOS (no codesign)
echo "📦 Building iOS (no-codesign)..."
if ! flutter build ios --no-codesign --no-tree-shake-icons; then
echo "❌ flutter build ios failed."
exit 1
fi
else
# Other OS: try Android APK if SDK present
if command -v adb >/dev/null 2>&1 || [ -n "${ANDROID_HOME:-}" ] || [ -n "${ANDROID_SDK_ROOT:-}" ]; then
echo "📦 Building Android APK (debug)..."
if ! flutter build apk --debug --no-tree-shake-icons; then
echo "❌ flutter build apk failed."
exit 1
fi
else
echo "ℹ️ Android SDK not detected; skipping APK build."
fi
fi
else
echo "ℹ️ Skipping build (set FLUTTER_PRECOMMIT_BUILD=1 to enable)."
fi
)

echo "✅ All checks passed! Proceeding with commit..."
17 changes: 11 additions & 6 deletions REUSE.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,15 @@
version = 1

[[annotations]]
path = ["package.json", "CHANGELOG.md", ".gitignore", "docs/CNAME"]
path = [
"package.json",
"CHANGELOG.md",
"**/.gitignore",
"docs/CNAME",
".husky/**",
"package-lock.json",
"**/.metadata",
]
precedence = "aggregate"
SPDX-FileCopyrightText = "2025 hexaTune LLC"
SPDX-License-Identifier = "MIT"
Expand All @@ -10,13 +18,10 @@ SPDX-License-Identifier = "MIT"
path = [
"hexagenapp/android/**",
"hexagenapp/ios/**",
"hexagenapp/linux/**",
"hexagenapp/web/**",
"hexagenapp/windows/**",
"hexagenapp/macos/**",
"hexagenapp/.gitignore",
"hexagenapp/.metadata",
"hexagenapp/test/**",
"hexagenapp/windows/**",
"hexagenapp/linux/**",
]
precedence = "aggregate"
SPDX-FileCopyrightText = "2025 hexaTune LLC"
Expand Down
1 change: 0 additions & 1 deletion hexagenapp/lib/main.dart
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
// SPDX-FileCopyrightText: 2025 hexaTune LLC
// SPDX-License-Identifier: MIT

import 'package:flutter/material.dart';

void main() {
Expand Down
2 changes: 2 additions & 0 deletions hexagenapp/test/widget_test.dart
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
// SPDX-FileCopyrightText: 2025 hexaTune LLC
// SPDX-License-Identifier: MIT
// This is a basic Flutter widget test.
//
// To perform an interaction with a widget in your test, use the WidgetTester
Expand Down
Loading