Skip to content

Commit dc47a0b

Browse files
committed
add pre-commit
1 parent fde0a4a commit dc47a0b

File tree

4 files changed

+182
-0
lines changed

4 files changed

+182
-0
lines changed

.flake8

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
[flake8]
2+
max-line-length = 100
3+
exclude =
4+
.git,
5+
.github,
6+
.vscode,
7+
.venv,
8+
__pycache__,
9+
build,
10+
dist,
11+
venv,
12+
script,
13+
thirdparty
14+
15+
ignore =
16+
E203,
17+
E266,
18+
E501,
19+
W503
20+
21+
max-complexity = 15
22+
23+
max-python-version = 3.12
24+
25+
count = True
26+
27+
show-source = True
28+
29+
format = pylint
30+
31+
require-plugins =
32+
flake8-docstrings
33+
34+
docstring-convention = google
35+
36+
inline-quotes = "

.gitignore

Lines changed: 93 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,93 @@
1+
# Byte-compiled / optimized / DLL files
2+
__pycache__/
3+
*.py[cod]
4+
*$py.class
5+
6+
# C extensions
7+
*.so
8+
9+
# Distribution / packaging
10+
.Python
11+
build/
12+
develop-eggs/
13+
dist/
14+
downloads/
15+
eggs/
16+
.eggs/
17+
lib/
18+
lib64/
19+
parts/
20+
sdist/
21+
var/
22+
wheels/
23+
share/python-wheels/
24+
*.egg-info/
25+
.installed.cfg
26+
*.egg
27+
MANIFEST
28+
29+
# PyInstaller
30+
# Usually these files are written by a python script from a template
31+
# before PyInstaller builds the exe, so as to inject date/other infos into it.
32+
*.manifest
33+
*.spec
34+
35+
# Installer logs
36+
pip-log.txt
37+
pip-delete-this-directory.txt
38+
39+
# Unit test / coverage reports
40+
htmlcov/
41+
.tox/
42+
.nox/
43+
.coverage
44+
.coverage.*
45+
.cache
46+
nosetests.xml
47+
coverage.xml
48+
*.cover
49+
*.py,cover
50+
.hypothesis/
51+
.pytest_cache/
52+
cover/
53+
54+
# Translations
55+
*.mo
56+
*.pot
57+
58+
# Jupyter Notebook
59+
.ipynb_checkpoints
60+
61+
# IPython
62+
profile_default/
63+
ipython_config.py
64+
65+
# Environments
66+
.env
67+
.venv
68+
env/
69+
venv/
70+
ENV/
71+
72+
# VS Code
73+
.vscode/
74+
75+
# PyCharm
76+
77+
.idea/
78+
79+
# macOS
80+
.DS_Store
81+
82+
# logs
83+
*.log
84+
logs/
85+
86+
# data-juicer
87+
outputs/
88+
# agentscope
89+
runs/
90+
91+
# docs
92+
trinity*.rst
93+
modules.rst

.pre-commit-config.yaml

Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
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-ast
10+
- id: check-json
11+
- id: check-merge-conflict
12+
- id: detect-private-key
13+
14+
- repo: https://github.com/psf/black
15+
rev: 23.7.0
16+
hooks:
17+
- id: black
18+
language_version: python3.10
19+
args: [--line-length=100]
20+
21+
- repo: https://github.com/pycqa/isort
22+
rev: 5.12.0
23+
hooks:
24+
- id: isort
25+
args: ["--profile", "black", "--filter-files"]
26+
27+
- repo: https://github.com/pycqa/flake8
28+
rev: 6.1.0
29+
hooks:
30+
- id: flake8
31+
additional_dependencies: [flake8-docstrings]
32+
args: [
33+
"--max-line-length=88",
34+
"--max-complexity=15",
35+
"--select=C,E,F,W,B,B950",
36+
"--ignore=E203,E266,E501,W503",
37+
]
38+
39+
- repo: https://github.com/pre-commit/mirrors-mypy
40+
rev: v1.7.0
41+
hooks:
42+
- id: mypy
43+
args: [
44+
--ignore-missing-imports,
45+
--disable-error-code=var-annotated,
46+
--disable-error-code=union-attr,
47+
--disable-error-code=assignment,
48+
--disable-error-code=attr-defined,
49+
--disable-error-code=import-untyped,
50+
--disable-error-code=truthy-function,
51+
--follow-imports=skip,
52+
--explicit-package-bases,
53+
]
-224 Bytes
Binary file not shown.

0 commit comments

Comments
 (0)