-
Notifications
You must be signed in to change notification settings - Fork 91
/
.pre-commit-config.yaml
88 lines (87 loc) · 3.01 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
exclude: (^kubernetes/|^vendor/|^ocfweb/static/fonts/bootstrap/|^\.activate.sh|^\.transpire.py)
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.4.0
hooks:
- id: check-added-large-files
- id: check-ast
- id: check-builtin-literals
- id: check-byte-order-marker
- id: check-case-conflict
- id: check-docstring-first
- id: check-executables-have-shebangs
- id: check-json
- id: check-merge-conflict
- id: check-symlinks
- id: check-vcs-permalinks
- id: check-xml
- id: check-yaml
- id: debug-statements
- id: detect-private-key
- id: double-quote-string-fixer
- id: end-of-file-fixer
- id: file-contents-sorter
- id: mixed-line-ending
- id: name-tests-test
- id: pretty-format-json
- id: requirements-txt-fixer
- id: sort-simple-yaml
- id: trailing-whitespace
- repo: https://github.com/PyCQA/flake8
rev: 6.0.0
hooks:
- id: flake8
- repo: https://github.com/pre-commit/mirrors-autopep8
rev: v2.0.2
hooks:
- id: autopep8
- repo: https://github.com/asottile/reorder-python-imports
rev: v3.9.0
hooks:
- id: reorder-python-imports
- repo: https://github.com/asottile/pyupgrade
rev: v3.4.0
hooks:
- id: pyupgrade
args: ['--py38-plus']
- repo: https://github.com/asottile/add-trailing-comma
rev: v2.4.0
hooks:
- id: add-trailing-comma
args: ['--py36-plus']
- repo: https://github.com/Lucas-C/pre-commit-hooks
rev: v1.5.1
hooks:
- id: remove-tabs
- id: remove-crlf
- repo: https://github.com/pre-commit/mirrors-scss-lint
rev: v0.59.0
hooks:
- id: scss-lint
- repo: local
hooks:
- id: no-top-level-header
language: pygrep
name: No top-level headers (markdown)
entry: ^#[^#!]
files: \.md$
# In Django, if you have an app like "announcements" and another app like
# "docs", it's not okay for both to provide templates with the same name
# (e.g. "index.html") since they all get thrown onto the same templates
# path. One of the applications' index.html will arbitrarily always be
# shown on both of the applications.
#
# To avoid this undesired behavior, the hook below forces you to prefix the
# templates with some directory first. In practice, your templates should
# all be at ocfweb/$app/templates/$app/.
#
# This kinda sucks, but that's the world we live in.
# https://stackoverflow.com/questions/3092865/django-view-load-template-from-calling-apps-dir-first
# https://stackoverflow.com/questions/30229600/django-template-tags-with-same-name
- id: app-templates-prefixed-with-app-name
language: system
name: App templates must be prefixed with app name
entry: bash -c 'echo "Make sure to prefix your template directories! (See .pre-commit-config.yaml for details)" && exit 1'
files: ^ocfweb/[^/]+/templates/[^/]+\.html$
ci:
submodules: true