
Security News
PEP 810 Proposes Explicit Lazy Imports for Python 3.15
An opt-in lazy import keyword aims to speed up Python startups, especially CLIs, without the ecosystem-wide risks that sank PEP 690.
@saji/git-hooks
Advanced tools
Zero config, opinionated git hooks that you can drop into your project and it will just work™.
If there’s EsLint config, will lint your files, if there’s test
npm
script will run it on push, if commit lint config, will check your
commit messages etc, etc, etc. For full list of hooks, see files in
*.d
directories.
Install hooks as a dependency in your project:
npm install --save-dev @saji/git-hooks
Install hooks package globally:
npm install -g @saji/git-hooks
Install it in any repository you want:
git install-hooks
Add -f
to force overwriting any existing hooks.
Clone this repository somewhere
In your repository run:
SOMEWHERE/install.sh`
hooksPath
Clone this repository somewhere
In your repository run:
git config core.hooksPath SOMEWHERE
You could use --global
to set it up for all your repositories.
git config --type=int hooks.$HOOK_NAME.enabled false
# e.g. hooks.npm-test.enabled
You can also disable a hook for single run, e.g.
git -c hooks.npm-test.enabled=false push
As a shorthand you can omit .enabled
:
git -c hooks.npm-test=false push
Apart from passing --no-verify
you can also use hooks.enabled
config option.
git config --type=int hooks.verbosity 2
set -x
npm-test
Hook detects if jest is being used for testing and if so, only runs tests that are related to modified files, but that heuristic is not perfect. You can force selected files to always be included, e.g.
git config hooks.pre-push.npm-test.forcedJestTests tests/storybook.test.js
branch-name
When configured with a extended grep regular expression will check if branch names match it, e.g.
git config hooks.pre-push.branch-name.allow-regexp '^((feat|fix|doc|chore)/|production$)'
You don’t have to list your main branch.
FAQs
Set of common git hooks
The npm package @saji/git-hooks receives a total of 11 weekly downloads. As such, @saji/git-hooks popularity was classified as not popular.
We found that @saji/git-hooks demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 0 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
An opt-in lazy import keyword aims to speed up Python startups, especially CLIs, without the ecosystem-wide risks that sank PEP 690.
Security News
Socket CEO Feross Aboukhadijeh discusses the recent npm supply chain attacks on PodRocket, covering novel attack vectors and how developers can protect themselves.
Security News
Maintainers back GitHub’s npm security overhaul but raise concerns about CI/CD workflows, enterprise support, and token management.