build: add precommit hook

This commit is contained in:
2025-05-25 12:49:49 +03:00
parent 2fed73ec5b
commit 91fb3d7a9f
3 changed files with 20 additions and 18 deletions

15
Makefile Normal file
View File

@@ -0,0 +1,15 @@
.PHONY: precommit precommit-install
# Run the pre-commit checks
precommit:
@echo "🔍 Formatting staged files..."
@git diff --cached --name-only | grep '\.dart$$' | xargs -r dart format > /dev/null
@git diff --cached --name-only | grep '\.md$$' | xargs -r prettier --write > /dev/null
@git ls-files -m | grep -E '\.dart$$|\.md$$' | xargs -r git add
# Install a pre-commit Git hook that runs `make precommit`
precommit-install:
@echo "#!/bin/sh" > .git/hooks/pre-commit
@echo "exec make precommit" >> .git/hooks/pre-commit
chmod +x .git/hooks/pre-commit
@echo "✅ Pre-commit hook installed."

View File

@@ -1,16 +0,0 @@
# flame_ui_example
A new Flutter project.
## Getting Started
This project is a starting point for a Flutter application.
A few resources to get you started if this is your first Flutter project:
- [Lab: Write your first Flutter app](https://docs.flutter.dev/get-started/codelab)
- [Cookbook: Useful Flutter samples](https://docs.flutter.dev/cookbook)
For help getting started with Flutter development, view the
[online documentation](https://docs.flutter.dev/), which offers tutorials,
samples, guidance on mobile development, and a full API reference.

View File

@@ -1,5 +1,8 @@
# Launch Screen Assets
You can customize the launch screen with your own desired assets by replacing the image files in this directory.
You can customize the launch screen with your own desired assets by replacing the image files in
this directory.
You can also do it by opening your Flutter project's Xcode project with `open ios/Runner.xcworkspace`, selecting `Runner/Assets.xcassets` in the Project Navigator and dropping in the desired images.
You can also do it by opening your Flutter project's Xcode project with
`open ios/Runner.xcworkspace`, selecting `Runner/Assets.xcassets` in the Project Navigator and
dropping in the desired images.