halildurmus_hooks 0.1.1
halildurmus_hooks: ^0.1.1 copied to clipboard
A curated collection of reusable scripts designed to simplify, automate, and standardize common Git hook workflows across projects.
A collection of scripts for Git hooks.
Use these small Dart CLIs to keep your repo healthy before commits or pushes.
Included scripts #
analyze- Runsdart analyze(orflutter analyzewith-f).format- Checks formatting withdart format --set-exit-if-changed.test- Runsdart test(orflutter testwith-f).check_commit- Validates a commit message against Conventional Commits.bump_version- Calculates the next version from commit messages and updatespubspec.yaml.update_changelog- Usesgit-cliffto updateCHANGELOG.md.
Usage #
Here's an example Lefthook configuration that uses these scripts:
pre-commit:
parallel: true
commands:
analyze:
glob: '*.{dart}'
run: dart run hooks:analyze example lib test
format:
glob: '*.{dart}'
run: dart run hooks:format {staged_files}
test:
glob: '{lib,test}/**/*.dart'
run: dart run hooks:test -- -j 1 --test-randomize-ordering-seed=random
commit-msg:
commands:
check_commit:
run: dart run hooks:check_commit {1}
Notes #
analyzeandtestscripts accept-f/--flutterto run via Flutter.bump_versionscript expects the latest Git tag to matchvX.Y.Zorpackage_name-vX.Y.Z.update_changelogscript requiresgit-cliffto be installed and available onPATH.