File tree Expand file tree Collapse file tree 3 files changed +73
-33
lines changed Expand file tree Collapse file tree 3 files changed +73
-33
lines changed Original file line number Diff line number Diff line change 1
1
repos :
2
- - repo : https://github.com/pre-commit/pre-commit-hooks
3
- rev : v4.6.0
4
- hooks :
5
- - id : trailing-whitespace
6
- exclude : ^weekly/
7
- - id : check-yaml
8
- - id : check-json
9
- - id : trailing-whitespace
2
+ - repo : https://github.com/pre-commit/pre-commit-hooks
3
+ rev : v4.6.0
4
+ hooks :
5
+ - id : trailing-whitespace
6
+ exclude : ^weekly/
7
+ - id : check-yaml
8
+ - id : check-json
9
+ - id : end-of-file-fixer
10
+ - id : trailing-whitespace
10
11
- repo : https://github.com/astral-sh/ruff-pre-commit
11
- # Ruff version.
12
12
rev : v0.7.4
13
13
hooks :
14
- # Run the linter.
15
14
- id : ruff
16
- args : [ --fix ]
15
+ args : ["check", "--select", "I", "--fix" ]
17
16
- id : ruff-format
Original file line number Diff line number Diff line change 11
11
12
12
PYPROJECT_TOML_CONTENT = """
13
13
[tool.ruff]
14
- # Exclude commonly ignored directories.
15
14
exclude = [
16
15
".bzr",
17
16
".direnv",
39
38
"site-packages",
40
39
"venv",
41
40
]
42
-
43
- # Same as Black.
44
41
line-length = 88
45
- indent-width = 4
42
+ indent-width=4
43
+ target-version = "py311"
46
44
47
45
[tool.ruff.lint]
46
+ extend-select = ["I", "U"]
48
47
select = ["E4", "E7", "E9", "F"]
49
48
ignore = []
50
-
51
49
fixable = ["ALL"]
52
50
unfixable = []
53
-
54
51
dummy-variable-rgx = "^(_+|(_+[a-zA-Z0-9_]*[a-zA-Z0-9]+?))$"
55
52
56
53
[tool.ruff.format]
57
54
quote-style = "double"
58
55
indent-style = "space"
59
56
skip-magic-trailing-comma = false
60
57
line-ending = "auto"
61
- docstring-code-format = false
58
+ docstring-code-format = true
62
59
docstring-code-line-length = "dynamic"
63
-
64
- [dependency-groups]
65
- dev = ["pre-commit>=4.0.1", "ruff>=0.8.1"]
66
60
"""
67
61
PRE_COMMIT_CONFIG_CONTENT = """
68
62
repos:
69
- - repo: https://github.com/pre-commit/pre-commit-hooks
70
- rev: v4.6.0
71
- hooks:
72
- - id: trailing-whitespace
73
- exclude: ^weekly/
74
- - id: check-yaml
75
- - id: check-json
76
- - id: trailing-whitespace
63
+ - repo: https://github.com/pre-commit/pre-commit-hooks
64
+ rev: v4.6.0
65
+ hooks:
66
+ - id: trailing-whitespace
67
+ exclude: ^weekly/
68
+ - id: check-yaml
69
+ - id: check-json
70
+ - id: end-of-file-fixer
71
+ - id: trailing-whitespace
77
72
- repo: https://github.com/astral-sh/ruff-pre-commit
78
- # Ruff version.
79
73
rev: v0.7.4
80
74
hooks:
81
- # Run the linter.
82
75
- id: ruff
83
- args: [ --fix ]
76
+ args: ["check", "--select", "I", "--fix" ]
84
77
- id: ruff-format
85
78
"""
86
79
Original file line number Diff line number Diff line change 1
1
[project ]
2
2
name = " dou-utils"
3
- version = " 0.1.7 "
3
+ version = " 0.1.8 "
4
4
description = " The utility package of Dou Inc."
5
5
readme = " README.md"
6
6
requires-python = " >=3.10"
@@ -29,3 +29,51 @@ dev = [
29
29
" setuptools>=75.6.0" ,
30
30
" wheel>=0.45.1" ,
31
31
]
32
+
33
+ [tool .ruff ]
34
+ exclude = [
35
+ " .bzr" ,
36
+ " .direnv" ,
37
+ " .eggs" ,
38
+ " .git" ,
39
+ " .hg" ,
40
+ " .ipynb_checkpoints" ,
41
+ " .mypy_cache" ,
42
+ " .nox" ,
43
+ " .pants.d" ,
44
+ " .pyenv" ,
45
+ " .pytest_cache" ,
46
+ " .pytype" ,
47
+ " .ruff_cache" ,
48
+ " .svn" ,
49
+ " .tox" ,
50
+ " .venv" ,
51
+ " .vscode" ,
52
+ " __pypackages__" ,
53
+ " _build" ,
54
+ " buck-out" ,
55
+ " build" ,
56
+ " dist" ,
57
+ " node_modules" ,
58
+ " site-packages" ,
59
+ " venv" ,
60
+ ]
61
+ line-length = 88
62
+ indent-width = 4
63
+ target-version = " py311"
64
+
65
+ [tool .ruff .lint ]
66
+ extend-select = [" I" , " U" ]
67
+ select = [" E4" , " E7" , " E9" , " F" ]
68
+ ignore = []
69
+ fixable = [" ALL" ]
70
+ unfixable = []
71
+ dummy-variable-rgx = " ^(_+|(_+[a-zA-Z0-9_]*[a-zA-Z0-9]+?))$"
72
+
73
+ [tool .ruff .format ]
74
+ quote-style = " double"
75
+ indent-style = " space"
76
+ skip-magic-trailing-comma = false
77
+ line-ending = " auto"
78
+ docstring-code-format = true
79
+ docstring-code-line-length = " dynamic"
You can’t perform that action at this time.
0 commit comments