forked from hotosm/tasking-manager
-
Notifications
You must be signed in to change notification settings - Fork 2
/
.pre-commit-config.yaml
106 lines (95 loc) · 3.15 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
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.6.0
hooks:
- id: trailing-whitespace
name: trim trailing whitespace
description: trims trailing whitespace.
entry: trailing-whitespace-fixer
language: python
types: [text]
stages: [commit, push, manual]
- id: end-of-file-fixer
name: fix end of files
description: ensures that a file is either empty, or ends with one newline.
entry: end-of-file-fixer
language: python
types: [text]
stages: [commit, push, manual]
- id: detect-aws-credentials
name: detect aws credentials
description: detects *your* aws credentials from the aws cli credentials file.
entry: detect-aws-credentials
language: python
types: [text]
args:
- "--allow-missing-credentials"
- id: detect-private-key
name: detect private key
description: detects the presence of private keys.
entry: detect-private-key
language: python
types: [text]
# - id: pretty-format-json
# name: pretty format json
# description: sets a standard for formatting json files.
# entry: pretty-format-json
# language: python
# types: [text]
# files: \.(json)$
# args:
# - "--autofix"
- id: check-merge-conflict
name: check for merge conflicts
description: checks for files that contain merge conflict strings.
entry: check-merge-conflict
language: python
types: [text]
- id: check-yaml
name: YAML File check
description: Checks if YAML File is valid and there are not any indention errors.
- id: check-added-large-files
name: check for added large files
description: prevents giant files from being committed.
entry: check-added-large-files
language: python
stages: [commit, push, manual]
args: ['--maxkb=10240']
# Versioning: Commit messages & changelog
- repo: https://github.com/commitizen-tools/commitizen
rev: v3.13.0
hooks:
- id: commitizen
stages: [commit-msg]
# Lint / autoformat: Python code
- repo: https://github.com/astral-sh/ruff-pre-commit
# Ruff version.
rev: "v0.4.2"
hooks:
# Run the linter
- id: ruff
files: ^backend/(?:.*/)*.*$
args: [--fix, --exit-non-zero-on-fix]
# Run the formatter
- id: ruff-format
files: ^backend/(?:.*/)*.*$
# INFO: Searches for code that is used or lingering around. (Disabled since there were a lot of work from dev end to remove stuff)
# - repo: https://github.com/asottile/dead
# rev: v1.5.2
# hooks:
# - id: dead
# Autoformat: YAML, JSON, Markdown, etc. (Disabled since pre-commit wasn't able to fix and needs dev input)
# - repo: https://github.com/pre-commit/mirrors-prettier
# rev: v3.1.0
# hooks:
# - id: prettier
# args:
# [
# --ignore-unknown,
# --no-error-on-unmatched-pattern,
# "!chart/**",
# "!CHANGELOG.md",
# "!CONTRIBUTING.md",
# "!frontend/pnpm-lock.yaml",
# "!backend/tests/test_data/**",
# ]