JeffYang52415 commited on
Commit
7c02764
·
unverified ·
1 Parent(s): 8cf2761

feat: add pre-commit

Browse files
Files changed (1) hide show
  1. .pre-commit-config.yaml +74 -0
.pre-commit-config.yaml ADDED
@@ -0,0 +1,74 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # .pre-commit-config.yaml
2
+
3
+ repos:
4
+ - repo: https://github.com/psf/black
5
+ rev: 23.9.1
6
+ hooks:
7
+ - id: black
8
+ args: ["--target-version=py311"]
9
+ additional_dependencies: ["typing-extensions>=4.8.0"]
10
+ - repo: https://github.com/PyCQA/flake8
11
+ rev: 6.1.0
12
+ hooks:
13
+ - id: flake8
14
+ additional_dependencies: ["typing-extensions>=4.8.0"]
15
+ - repo: https://github.com/PyCQA/isort
16
+ rev: 5.12.0
17
+ hooks:
18
+ - id: isort
19
+ args: ["--profile=black"]
20
+ - repo: https://github.com/pre-commit/mirrors-mypy
21
+ rev: v1.5.1
22
+ hooks:
23
+ - id: mypy
24
+ args: ["--python-version=3.11", "--install-types", "--non-interactive"]
25
+ additional_dependencies:
26
+ - "typing-extensions>=4.8.0"
27
+ - repo: https://github.com/pre-commit/pre-commit-hooks
28
+ rev: v4.5.0
29
+ hooks:
30
+ - id: check-yaml
31
+ - id: check-toml
32
+ - id: end-of-file-fixer
33
+ - id: trailing-whitespace
34
+ - id: detect-aws-credentials
35
+ args: ["--allow-missing-credentials"]
36
+ - id: detect-private-key
37
+ - id: end-of-file-fixer
38
+ - id: check-added-large-files
39
+ - id: check-ast
40
+ - id: check-byte-order-marker
41
+ - id: check-case-conflict
42
+ - id: check-docstring-first
43
+ - id: check-json
44
+ - id: debug-statements
45
+ - id: detect-private-key
46
+ - id: end-of-file-fixer
47
+ - id: trailing-whitespace
48
+ - id: mixed-line-ending
49
+ - repo: https://github.com/myint/autoflake
50
+ rev: v2.2.1
51
+ hooks:
52
+ - id: autoflake
53
+ args:
54
+ [
55
+ "--in-place",
56
+ "--remove-unused-variables",
57
+ "--remove-all-unused-imports",
58
+ "--ignore-init-module-imports",
59
+ "--exclude=tests/*",
60
+ ]
61
+ - repo: https://github.com/pre-commit/mirrors-prettier
62
+ rev: v2.7.1
63
+ hooks:
64
+ - id: prettier
65
+ types_or: [markdown, yaml]
66
+ - repo: https://github.com/astral-sh/ruff-pre-commit
67
+ # Ruff version.
68
+ rev: v0.4.4
69
+ hooks:
70
+ # Run the linter.
71
+ - id: ruff
72
+ args: [--fix]
73
+ # Run the formatter.
74
+ - id: ruff-format