-
Notifications
You must be signed in to change notification settings - Fork 10
Expand file tree
/
Copy path.pre-commit-config.yaml
More file actions
41 lines (37 loc) · 1.35 KB
/
Copy path.pre-commit-config.yaml
File metadata and controls
41 lines (37 loc) · 1.35 KB
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
# See https://pre-commit.com for more information
# See https://pre-commit.com/hooks.html for more hooks
# `pre-commit autoupdate` to update hooks
# exclude 部分的使用,参考了pyproject.toml中的相关使用 https://stackoverflow.com/questions/61032281/exclude-some-files-on-running-black-using-pre-commit
#exclude: |
# (
# mkdocs.yml
# )
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.6.0
hooks:
- id: trailing-whitespace
- id: end-of-file-fixer
- id: check-yaml
- repo: https://github.com/psf/black
rev: 24.4.0
hooks:
- id: black
language_version: python3.12
- repo: https://github.com/pycqa/isort
rev: 5.13.2
hooks:
- id: isort
name: isort (python)
args: ["--profile", "black", "--filter-files"]
- repo: https://github.com/python-poetry/poetry
rev: 1.8.0
hooks:
# - id: poetry-export
# name: poetry-export-all
# description: run poetry export with dev group to sync lock file with requirements-all.txt
# args: ["--format", "requirements.txt", "--output", "requirements-all.txt", "--with", "dev"]
- id: poetry-export
name: poetry-export-no-dev
description: run poetry export to sync lock file with requirements.txt
args: ["--format", "requirements.txt", "--output", "requirements.txt"]