Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/soulshake/git-templates
My pre-commit hooks, etc
https://github.com/soulshake/git-templates
git
Last synced: 3 days ago
JSON representation
My pre-commit hooks, etc
- Host: GitHub
- URL: https://github.com/soulshake/git-templates
- Owner: soulshake
- Created: 2017-02-13T17:42:58.000Z (almost 8 years ago)
- Default Branch: master
- Last Pushed: 2022-07-05T11:55:22.000Z (over 2 years ago)
- Last Synced: 2024-12-23T13:53:49.742Z (5 days ago)
- Topics: git
- Language: Shell
- Homepage:
- Size: 23.4 KB
- Stars: 1
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Git hooks
Note: This directory should either be located at `~/.git-templates` or you need to set your [git template directory](https://git-scm.com/docs/git-init#_template_directory).
## Installation
`git clone --recursive [email protected]:soulshake/git-templates.git ~/.git-templates`
To get these templates in your existing repos, you can delete the repository's `.git/hooks` directory and run `git init` again to pull the new hooks in `~/.git-templates/hooks`.
## Dependencies
- `shellcheck`
- `shellfmt`
- `aspell` (your personal whitelist will be located at `~/.git-spell-check`)## Pre-commit hooks
This repo contains the following pre-commit hooks:
- Don't allow committing directly to master unless we're the owners of the `origin` repo (hackish check)
- Run spell check on newly committed lines
- Run `shellcheck` on new or modified `.sh` files
- Run `shellfmt` on new or modified `.sh` files**Note:** You can bypass pre-commit hooks by passing the `-n` (`--no-verify`) to `git commit`.
You can disable a hook by removing the file from your repository's `.git/hooks/pre-commit.d/` directory or appending any extension other than `.sh`.
## To do
- Interactive prompt to override checks