This repository has been archived by the owner on Jun 19, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 2
/
.pre-commit-config.yaml
153 lines (135 loc) · 5.82 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
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
---
# INFO: https://pre-commit.com/hooks.html
# NOTE: Borrowed a bunch from https://github.com/Yelp/swagger_zipkin/blob/master/.pre-commit-config.yaml
# All hooks here: https://github.com/pre-commit/pre-commit-hooks
repos:
- repo: git://github.com/pre-commit/pre-commit-hooks
sha: v0.9.1
hooks:
# INFO: Trims trailing whitespace.
# Markdown linebreak trailing spaces preserved for .md and.markdown; use args: ['--markdown-linebreak-ext=txt,text'] to add other extensions, args: ['--markdown-linebreak-ext=*'] to preserve them for all files, or args: ['--no-markdown-linebreak-ext'] to disable and always trim.
- id: trailing-whitespace
# INFO: Makes sure files end in a newline and only a newline.
- id: end-of-file-fixer
# INFO: Runs autopep8 over python source.
# Ignore PEP 8 violation types with args: ['-i', '--ignore=E000,...'] or through configuration of the [pycodestyle] section in setup.cfg / tox.ini.
- id: autopep8-wrapper
# INFO: Checks for a common error of placing code before the docstring.
- id: check-docstring-first
# INFO: Attempts to load all json files to verify syntax.
- id: check-json
files: \.(bowerrc|jshintrc|json)$
# INFO: Attempts to load all yaml files to verify syntax.
- id: check-yaml
# INFO: Check for pdb / ipdb / pudb statements in code.
- id: debug-statements
# - id: name-tests-test
# - id: flake8
# args: ['--max-line-length=200']
- id: flake8
exclude: ^docs/source/conf.py$
args: ['--max-line-length=200']
- id: check-ast
# INFO: Sorts entries in requirements.txt
- id: requirements-txt-fixer
# INFO: Checks that non-binary executables have a proper shebang.
- id: check-executables-have-shebangs
# INFO: Add # -*- coding: utf-8 -*- to the top of python files.
# To remove the coding pragma pass --remove (useful in a python3-only codebase)
- id: fix-encoding-pragma
# sort-simple-yaml - Sorts simple YAML files which consist only of top-level keys, preserving comments and blocks.
# double-quote-string-fixer - This hook replaces double quoted strings with single quoted strings.
# SOURCE: https://github.com/Yelp/task_processing/blob/master/.pre-commit-config.yaml
# - id: fix-encoding-pragma
# language_version: python3.6
# args: [--remove]
- repo: git://github.com/pre-commit/mirrors-isort
sha: '4b74ac14df891a0958e5355c5e60d110f0bc45e0'
hooks:
- id: isort
# SOURCE: https://github.com/Yelp/paasta/blob/master/.pre-commit-config.yaml
- repo: local
hooks:
- id: patch-enforce-autospec
name: mock.patch enforce autospec
description: This hook ensures all mock.patch invocations specify an autospec
entry: paasta_tools/contrib/mock_patch_checker.py
language: script
files: ^tests/.*\.py$
- id: no-catchall-except
name: Prevent catchall except
entry: except:$
language: pygrep
files: \.py$
# ################################################################################################
# # NOTE: Borrowed this from https://github.com/pre-commit/pre-commit-hooks/blob/master/.pre-commit-config.yaml#L7
# ################################################################################################
# - repo: https://github.com/pre-commit/pre-commit
# sha: v0.16.3
# hooks:
# - id: validate_manifest
# - repo: https://github.com/asottile/reorder_python_imports
# sha: v0.3.5
# hooks:
# - id: reorder-python-imports
# language_version: python3.6
# - repo: https://github.com/asottile/pyupgrade
# sha: v1.1.4
# hooks:
# - id: pyupgrade
# - repo: https://github.com/asottile/add-trailing-comma
# sha: v0.6.4
# hooks:
# - id: add-trailing-comma
# ################################################################################################
# ################################################################################################
# ################################################################################################
# # SOURCE: https://github.com/Yelp/task_processing/blob/master/.pre-commit-config.yaml
# - repo: https://github.com/asottile/reorder_python_imports.git
# sha: v0.3.1
# hooks:
# - id: reorder-python-imports
# language_version: python3.6
# args: [
# --remove-import, 'from __future__ import absolute_import',
# --remove-import, 'from __future__ import print_function',
# --remove-import, 'from __future__ import unicode_literals',
# ]
# ################################################################################################
# SOURCE: https://github.com/Yelp/pgctl/blob/050012b80dd612df21ec0a76df928fe9ecdd4736/.pre-commit-config.yaml
# - id: autopep8-wrapper
# - id: check-added-large-files
# - id: check-case-conflict
# - id: check-docstring-first
# - id: check-merge-conflict
# - id: check-yaml
# - id: debug-statements
# - id: detect-private-key
# exclude: ^\.activate\.sh$
# - id: double-quote-string-fixer
# - id: end-of-file-fixer
# exclude: ^\.activate\.sh$
# - id: flake8
# - id: requirements-txt-fixer
# - id: trailing-whitespace
# - repo: git://github.com/asottile/reorder_python_imports
# sha: v0.3.5
# hooks:
# - id: reorder-python-imports
# args:
# - --add-import
# - from __future__ import absolute_import
# - --add-import
# - from __future__ import unicode_literals
# - repo: local
# hooks:
# - id: system
# name: PyLint
# entry: python -m pylint.__main__
# language: system
# files: \.py$
# - repo: https://github.com/asottile/pyupgrade
# sha: v1.0.4
# hooks:
# - id: pyupgrade
# language_version: python3