File tree 5 files changed +72
-134
lines changed
5 files changed +72
-134
lines changed Original file line number Diff line number Diff line change @@ -14,22 +14,14 @@ repos:
14
14
- id : end-of-file-fixer
15
15
- id : trailing-whitespace
16
16
17
- # black - formatting
18
- - repo : https://github.com/psf/black
19
- rev : 24.4.2
20
- hooks :
21
- - id : black
22
- name : black
23
- args :
24
- - " --config"
25
- - " ./pyproject.toml"
26
-
27
- # ruff - linting
17
+ # ruff - linting + formatting
28
18
- repo : https://github.com/astral-sh/ruff-pre-commit
29
- rev : " v0.4.5 "
19
+ rev : " v0.4.6 "
30
20
hooks :
31
21
- id : ruff
32
22
name : ruff
23
+ - id : ruff-format
24
+ name : ruff-format
33
25
34
26
# mypy - lint-like type checking
35
27
- repo : https://github.com/pre-commit/mirrors-mypy
Original file line number Diff line number Diff line change @@ -4,7 +4,7 @@ version = "0.1.0"
4
4
description = " Python boilerplate"
5
5
authors = [
" Samuel MARLHENS <[email protected] >" ]
6
6
packages = [
7
- { include = " *" , from = " src" }
7
+ { include = " *" , from = " src" }
8
8
]
9
9
license = " MIT"
10
10
readme = " README.md"
@@ -20,11 +20,10 @@ python = "^3.12"
20
20
[tool .poetry .dev-dependencies ]
21
21
pytest = " 8.2.1"
22
22
pytest-cov = " 5.0.0"
23
- black = " 24.4.2"
24
23
mypy = " 1.10.0"
25
24
bandit = " 1.7.8"
26
25
docformatter = " 1.7.5"
27
- ruff = " 0.4.5 "
26
+ ruff = " 0.4.6 "
28
27
29
28
[build-system ]
30
29
requires = [" poetry-core>=1.0.0" ]
@@ -35,29 +34,60 @@ backend-path = ["src"]
35
34
addopts = " -vvv"
36
35
testpaths = " tests"
37
36
38
- [tool .black ]
39
- line_length = 90
40
- target_version = [' py310' ]
41
-
42
37
[tool .ruff ]
43
- exclude = [
44
- " .venv" ,
45
- " .git" ,
38
+ extend-exclude = [
46
39
" __pycache__" ,
47
40
" build" ,
48
41
" dist" ,
49
- " venv" ,
50
42
]
51
- ignore = []
43
+ target-version = " py312 "
52
44
line-length = 90
53
- select = [
45
+ src = [" src" , " tests" ]
46
+
47
+ [tool .ruff .lint ]
48
+ extend-select = [
49
+ " C4" ,
50
+ " D200" ,
51
+ " D201" ,
52
+ " D204" ,
53
+ " D205" ,
54
+ " D206" ,
55
+ " D210" ,
56
+ " D211" ,
57
+ " D213" ,
58
+ " D300" ,
59
+ " D400" ,
60
+ " D402" ,
61
+ " D403" ,
62
+ " D404" ,
63
+ " D419" ,
54
64
" E" ,
55
65
" F" ,
56
- " W " ,
66
+ " G010 " ,
57
67
" I001" ,
68
+ " INP001" ,
69
+ " N805" ,
70
+ " PERF101" ,
71
+ " PERF102" ,
72
+ " PERF401" ,
73
+ " PERF402" ,
74
+ " PGH004" ,
75
+ " PGH005" ,
76
+ " PIE794" ,
77
+ " PIE796" ,
78
+ " PIE807" ,
79
+ " PIE810" ,
80
+ " RET502" ,
81
+ " RET503" ,
82
+ " RET504" ,
83
+ " RET505" ,
84
+ " RUF015" ,
85
+ " RUF100" ,
86
+ " S101" ,
87
+ " T20" ,
88
+ " W" ,
58
89
]
59
- src = [" src" , " tests" ]
60
90
61
91
[mypy ]
62
92
files = [" src" ]
63
- strict_optional = false
93
+ strict = " true "
Original file line number Diff line number Diff line change @@ -3,7 +3,7 @@ def hello_world():
3
3
4
4
5
5
def main ():
6
- print (hello_world ())
6
+ print (hello_world ()) # noqa: T201 print only used as placeholder :)
7
7
8
8
9
9
if __name__ == "__main__" :
Original file line number Diff line number Diff line change 2
2
3
3
4
4
def test_hello_world ():
5
- assert hello_world () == "Hello World"
5
+ if hello_world () != "Hello World" :
6
+ raise ValueError ('Expected value to be "Hello World"' )
You can’t perform that action at this time.
0 commit comments