-
Notifications
You must be signed in to change notification settings - Fork 7
/
.pre-commit-config.yaml
54 lines (48 loc) · 1.77 KB
/
.pre-commit-config.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
---
# pre-commit hook catalog -> https://pre-commit.com/hooks.html
# Manually run all pre-commit checks with:
# `pre-commit autoupdate`
# `pre-commit run --all-files`
#
# Manually ignore pre-commit checks with --no-verify...
# `git commit --no-verify <filepath> -m "Some message here"
repos:
# auto-format code for the --pyXXXXXXX argument.
- repo: https://github.com/asottile/pyupgrade
rev: v2.32.0
hooks:
- id: pyupgrade
args: ["--py3-plus"]
- repo: https://github.com/regebro/pyroma
rev: v3.2
hooks:
- id: pyroma
args: ["-d ./"] # Run against the current directory
##
# - repo: https://github.com/asottile/dead
# rev: v1.4.0
# hooks:
# - id: dead
- repo: https://github.com/pre-commit/pygrep-hooks
rev: v1.9.0 # Use the ref you want to point at
hooks:
- id: python-no-eval
- id: rst-backticks
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.1.0 # WARNING changing this to v4.3.0 was a timesuck and I rolled-back
hooks:
- id: check-yaml
- id: check-json
- id: check-docstring-first # Forbid code before a function's docstring
- id: check-symlinks # Look for isolated symlinks
- id: check-shebang-scripts-are-executable # Fix permissions on scripts
- id: end-of-file-fixer
- id: requirements-txt-fixer
- id: fix-byte-order-marker
- id: trailing-whitespace
- id: end-of-file-fixer
- id: no-commit-to-branch # By default, protect 'master' and 'main'
args: ['--branch', 'master', '--branch', 'main']
# https://github.com/pre-commit/pre-commit-hooks/issues/106
- id: fix-encoding-pragma # Remove "# -*- coding: utf-8 -*-" from files
args: ['--remove'] # Python3 doesn't need the utf8 pragma