-
Notifications
You must be signed in to change notification settings - Fork 29
/
Copy path.pre-commit-config.yaml
90 lines (71 loc) · 2.87 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
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
---
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v2.0.0 # Use the ref you want to point at
hooks:
# Makes sure files end in a newline and only a newline.
# See also: mixed-line-ending
- id: end-of-file-fixer
# Trims trailing whitespace.
- id: trailing-whitespace
args: [--markdown-linebreak-ext=md]
# Prevent giant files from being committed.
# Specify what is "too large" with args: ['--maxkb=123'] (default=500kB)
- id: check-added-large-files
# Checks that non-binary executables have a proper shebang.
- id: check-executables-have-shebangs
# Checks for symlinks which do not point to anything.
- id: check-symlinks
# Attempts to load all json files to verify syntax.
- id: check-json
# git {{{
# Check for files that contain merge conflict strings.
- id: check-merge-conflict
# git }}}
# Secrets {{{
# Check for the existence of private keys.
- id: detect-private-key
# Checks for the existence of AWS secrets that you have set up with the
# AWS CLI. The following arguments are available:
# --credentials-file - additional AWS CLI style configuration file in a
# non-standard location to fetch configured credentials from. Can be
# repeated multiple times.
- id: detect-aws-credentials
args: [--allow-missing-credentials]
# Secrets }}}
# Python {{{
# Remove # -*- coding: utf-8 -*- to the top of python files.
- id: fix-encoding-pragma
args: [--remove]
# Sorts entries in requirements.txt and removes incorrect entry for
# `pkg-resources==0.0.0`
- id: requirements-txt-fixer
# Assert that files in tests/ end in `_test.py`.
# - id: name-tests-test
# Check for debugger imports and py37+ `breakpoint()` calls in python
# source.
- id: debug-statements
# Checks for a common error of placing code before the docstring.
- id: check-docstring-first
# - `check-builtin-literals` - Require literal syntax when initializing
# empty or zero Python builtin types.
# - Allows calling constructors with positional arguments (e.g.,
# `list('abc')`).
# - Allows calling constructors from the `builtins` (`__builtin__`)
# namespace (`builtins.list()`).
# - Ignore this requirement for specific builtin types with
# `--ignore=type1,type2,…`.
# - Forbid `dict` keyword syntax with `--no-allow-dict-kwargs`.
# Run flake8 on your python files.
- repo: https://gitlab.com/pycqa/flake8
rev: 3.7.3
hooks:
- id: flake8
# Python }}}
# shellcheck {{{
- repo: git://github.com/detailyang/pre-commit-shell
rev: 1.0.4
hooks:
- id: shell-lint
# shellcheck }}}
# vim: ft=yaml foldmethod=marker