Skip to content

Commit 90b96ab

Browse files
committed
chore: restore pre-commit configuration
Restore .pre-commit-config.yaml that was in original PR but missing from current branch. This file provides code quality, security scanning, and formatting validation hooks.
1 parent 2e57298 commit 90b96ab

1 file changed

Lines changed: 57 additions & 0 deletions

File tree

.pre-commit-config.yaml

Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
repos:
2+
- repo: https://github.com/pre-commit/pre-commit-hooks
3+
rev: v4.4.0
4+
hooks:
5+
- id: trailing-whitespace
6+
- id: end-of-file-fixer
7+
- id: check-yaml
8+
- id: check-added-large-files
9+
- id: check-merge-conflict
10+
- id: debug-statements
11+
- id: check-executables-have-shebangs
12+
13+
- repo: https://github.com/psf/black
14+
rev: 23.7.0
15+
hooks:
16+
- id: black
17+
language_version: python3
18+
args: [--line-length=88]
19+
20+
- repo: https://github.com/pycqa/flake8
21+
rev: 6.0.0
22+
hooks:
23+
- id: flake8
24+
args: [--max-line-length=88, --extend-ignore=E203,W503]
25+
26+
- repo: https://github.com/pycqa/isort
27+
rev: 5.12.0
28+
hooks:
29+
- id: isort
30+
args: [--profile=black]
31+
32+
- repo: https://github.com/Yelp/detect-secrets
33+
rev: v1.4.0
34+
hooks:
35+
- id: detect-secrets
36+
args: ['--baseline', '.secrets.baseline']
37+
exclude: |
38+
(?x)^(
39+
config_template\.json|
40+
\.secrets\.baseline
41+
)$
42+
43+
- repo: https://github.com/pre-commit/mirrors-mypy
44+
rev: v1.4.1
45+
hooks:
46+
- id: mypy
47+
additional_dependencies: [types-requests]
48+
args: [--ignore-missing-imports]
49+
50+
- repo: local
51+
hooks:
52+
- id: reddit-config-check
53+
name: Check Reddit config safety
54+
entry: python -c "import json; config = json.load(open('config.json')) if __import__('os').path.exists('config.json') else {}; exit(1) if not config.get('anonymize_moderators', True) else exit(0)"
55+
language: system
56+
files: config\.json$
57+
pass_filenames: false

0 commit comments

Comments
 (0)