From 91fb3d7a9f31831e958b7a86fef1067e72971517 Mon Sep 17 00:00:00 2001 From: Chen Asraf Date: Sun, 25 May 2025 12:49:49 +0300 Subject: [PATCH] build: add precommit hook --- Makefile | 15 +++++++++++++++ example/README.md | 16 ---------------- .../LaunchImage.imageset/README.md | 7 +++++-- 3 files changed, 20 insertions(+), 18 deletions(-) create mode 100644 Makefile delete mode 100644 example/README.md diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..a6e9edd --- /dev/null +++ b/Makefile @@ -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." diff --git a/example/README.md b/example/README.md deleted file mode 100644 index aacca53..0000000 --- a/example/README.md +++ /dev/null @@ -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. diff --git a/example/ios/Runner/Assets.xcassets/LaunchImage.imageset/README.md b/example/ios/Runner/Assets.xcassets/LaunchImage.imageset/README.md index 89c2725..d880e1f 100644 --- a/example/ios/Runner/Assets.xcassets/LaunchImage.imageset/README.md +++ b/example/ios/Runner/Assets.xcassets/LaunchImage.imageset/README.md @@ -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. \ No newline at end of file +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.