forked from WordPress/openverse-frontend
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.pre-commit-config.yaml
121 lines (111 loc) · 3.48 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
exclude: Pipfile\.lock|migrations|\.idea|node_modules
repos:
- repo: local # More local hooks are defined at the bottom.
hooks:
- id: i18n
name: i18n
# Check if the i18n files have been downloaded by checking if the Arabic translation exists
# Download the i18n files if they do not exist
entry: bash -c 'if [ ! -f "$(dirname "$dir")"/src/locales/ar.json ]; then pnpm i18n; fi'
language: system
pass_filenames: false
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.0.1
hooks:
- id: trailing-whitespace
args: [--markdown-linebreak-ext=md]
- id: check-executables-have-shebangs
- id: check-json
exclude: tsconfig.json # contains comments
- id: check-case-conflict
- id: check-toml
- id: check-merge-conflict
- id: check-xml
- id: check-yaml
- id: end-of-file-fixer
exclude: test/tapes/.+\.json5
- id: check-symlinks
- id: mixed-line-ending
- id: fix-encoding-pragma
args:
- --remove
- id: requirements-txt-fixer
- repo: https://github.com/PyCQA/isort
rev: 5.9.1
hooks:
- id: isort
files: \.py$
exclude: ^build/.*$|^.tox/.*$|^venv/.*$
args:
- --lines-after-imports=2
- --multi-line=3
- --trailing-comma
- --force-grid-wrap=0
- --use-parentheses
- --ensure-newline-before-comments
- --line-length=88
- repo: https://github.com/PyCQA/flake8
rev: 3.9.2
hooks:
- id: flake8
args:
- --config=automations/.flake8
- repo: https://github.com/ambv/black
rev: 22.3.0
hooks:
- id: black
args:
- --safe
- repo: https://github.com/pre-commit/mirrors-prettier
rev: v2.6.0
hooks:
- id: prettier
additional_dependencies:
- repo: https://github.com/pre-commit/mirrors-eslint
rev: v8.15.0
hooks:
- id: eslint
files: \.(js|ts|vue)$
exclude: ^nuxt-template-overrides/.*$
'types': [file] # ESLint only accepts [javascript] by default
args:
- --ignore-path=.gitignore
- --ignore-path=.eslintignore
- --max-warnings=0
additional_dependencies:
- '@babel/[email protected]'
- '@intlify/[email protected]'
- '@nuxtjs/[email protected]'
- '@typescript-eslint/[email protected]'
- '@typescript-eslint/[email protected]'
- repo: https://github.com/koalaman/shellcheck-precommit
rev: v0.8.0
hooks:
- id: shellcheck
- repo: local # More local hooks are defined at the top.
hooks:
- id: types
name: types
entry: bash -c 'pnpm types'
language: system
pass_filenames: false
- id: test:unit
name: test:unit
entry: bash -c 'pnpm test:unit'
language: system
pass_filenames: false
stages:
- push