simple-pre-commit
Advanced tools
Comparing version 1.2.0 to 1.2.1
{ | ||
"name": "simple-pre-commit", | ||
"version": "1.2.0", | ||
"version": "1.2.1", | ||
"description": "A simple, zero dependency tool for setting up git pre-commit hook for small projects", | ||
@@ -9,4 +9,4 @@ "author": "Mikhail Gorbunov <toplenboren@gmail.com> (toplenboren.gituhb.io)", | ||
"scripts": { | ||
"publish": "clean-publish --without-publish", | ||
"postinstall": "node ./postinstall.js" | ||
"postinstall": "node ./postinstall.js", | ||
"uninstall": "node ./uninstall.js" | ||
}, | ||
@@ -13,0 +13,0 @@ "keywords": [ |
@@ -9,39 +9,4 @@ # simple-pre-commit | ||
- Easy to configure (one line in `package.json`) | ||
- Lightweight*: | ||
- Lightweight | ||
| Package name | Unpacked size | | ||
| ------------- | ------------- | | ||
| husky v4 `4.3.8` | `53.5 kB` | | ||
| husky v5 `5.0.9` | `24.5 kB` | | ||
| pre-commit `1.2.2` | `~80 kB` | | ||
| **simple-pre-commit** `1.1.3` | `9.02 kB` | | ||
### What is pre-commit hook? | ||
Pre-commit hook is a command that is going to be run every time you commit a file to git. | ||
If pre-commit hook fails, then commit aborts. | ||
Usually you would like to run `linters` and `code-formatters` on every staged file to ensure code quality in your project | ||
Check out [lint-staged](https://github.com/okonet/lint-staged#readme). It works really well with `simple-pre-commit` | ||
You can look up about git hooks on [git book](https://git-scm.com/book/en/v2/Customizing-Git-Git-Hooks) | ||
### When to use it | ||
`simple-pre-commit` works well for small-sized projects when you need quickly setup `pre-commit` hook with one or a few commands and forget about it. | ||
However, this package only allows you to set the `pre-commit` hook. If you need, for example `pre-push` hook or something else — this package wouln't be able to help you | ||
Also, this package requires you to manually update the `pre-commit` hook. If you want update `pre-commit` hook often - this is probably not the best choice | ||
If you need multiple hooks, flexible configuration or git hook automatic update feature — please check out other packages: | ||
* [Lefthook](https://github.com/Arkweid/lefthook) | ||
* [husky](https://github.com/Arkweid/lefthook) | ||
* [pre-commit](https://github.com/pre-commit/pre-commit) | ||
## Usage | ||
@@ -48,0 +13,0 @@ |
@@ -78,3 +78,2 @@ const fs = require('fs') | ||
// every function here should accept projectRootPath as first argument and return either string or undefined | ||
const sources = [ | ||
@@ -81,0 +80,0 @@ () => _getCommandFromFile(projectRootPath, '.simple-pre-commit.json'), |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
9155
175
61