Skip to content

Instantly share code, notes, and snippets.

@bskiefer
Created April 1, 2022 17:04
Show Gist options
  • Save bskiefer/49ba4ee28620877e0d6fbacc7fb550f0 to your computer and use it in GitHub Desktop.
Save bskiefer/49ba4ee28620877e0d6fbacc7fb550f0 to your computer and use it in GitHub Desktop.
pre-commit hooks & config
repos:
- hooks:
- id: trailing-whitespace
- id: check-docstring-first
- id: check-json
- id: pretty-format-json
- id: check-merge-conflict
- id: check-yaml
- id: debug-statements
- id: name-tests-test
- id: requirements-txt-fixer
- id: double-quote-string-fixer
repo: "https://github.com/pre-commit/pre-commit-hooks"
rev: v4.1.0
- hooks:
- id: add-trailing-comma
repo: "https://github.com/asottile/add-trailing-comma"
rev: v2.2.2
- hooks:
- id: php-stan
files: \.(php)$
repo: "https://github.com/digitalpulp/pre-commit-php"
rev: 1.4.0
- hooks:
- id: check-hooks-apply
- id: check-useless-excludes
repo: meta
- hooks:
- id: php-lint
- id: composer-normalize-fix
- id: composer-validate
- id: blade-formatter
args: [--write]
- id: php-cs
files: \.(php)$
args: [--standard=PSR2 -e -p -n]
- id: php-cbf
name: PSR-2
files: \.(php)$
args: [--standard=PSR2 -e -p -n]
- id: php-cbf
name: PSR-12
files: \.(php)$
args: [--standard=PSR12 -e -p -n]
repo: "git@github.com:bskiefer/pre-commit-php.git"
rev: '1.6'
- hooks:
- id: dockerfilelint
stages:
- commit
repo: "https://github.com/pryorda/dockerfilelint-precommit-hooks"
rev: v0.1.0
- hooks:
- additional_dependencies:
- eslint@6.1.0
- eslint-config-google@0.7.1
- eslint-loader@1.6.1
- eslint-plugin-react@7.14.2
- eslint-config-standard-react@8.0.0
- babel-eslint@6.1.2
- eslint-plugin-babel@5.3.0
- eslint-config-react-app@4.0.1
- eslint-plugin-import@2.18.2
- eslint-config-standard@12.0.0
- eslint-plugin-standard@4.0.0
- eslint-plugin-node@8.0.1
- eslint-plugin-promise@4.2.1
- laravel-mix-eslint@0.1.3
- eslint-plugin-html@latest
args:
- "--ignore-path=~/.js/.eslintignore"
- "--config=~/.js/.eslintrc.js"
id: eslint
files: \.[jt]sx?$
verbose: false
types: [file]
repo: "https://github.com/pre-commit/mirrors-eslint"
rev: v8.12.0
- repo: https://github.com/hadolint/hadolint
rev: v2.10.0
hooks:
- id: hadolint
- repo: https://github.com/hadolint/hadolint
rev: v2.10.0
hooks:
- id: hadolint-docker
- repo: https://github.com/macisamuele/language-formatters-pre-commit-hooks
rev: v2.3.0
hooks:
- id: pretty-format-golang
args: [--autofix]
- repo: https://github.com/PeterMosmans/jenkinslint
rev: master
hooks:
- id: jenkinslint
args: [https://...jenkins_url.../]
# Run pre-commit hooks
alias pcr="pre-commit run --config ~/.pre-commit-config.yaml"
# Install pre-commit hooks for project
alias pci="pre-commit install --config ~/.pre-commit-config.yaml --install-hooks"
# Update dependencies
alias pcu="pre-commit autoupdate --config ~/.pre-commit-config.yaml"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment