Skip to content

Commit c62e20a

Browse files
committed
ruff: initialize in pre-commit-config, .vscode, pyproject.toml
1 parent 1c885e1 commit c62e20a

3 files changed

Lines changed: 39 additions & 8 deletions

File tree

.pre-commit-config.yaml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,10 @@
11
repos:
2+
- repo: https://github.com/astral-sh/ruff-pre-commit
3+
rev: v0.2.1
4+
hooks:
5+
- id: ruff
6+
args: [--fix, --exit-non-zero-on-fix]
7+
28
- repo: https://github.com/psf/black
39
rev: 23.1.0
410
hooks:
@@ -23,12 +29,6 @@ repos:
2329
name: isort (python)
2430
args: ['--force-single-line-imports', '--profile', 'black']
2531

26-
- repo: https://github.com/pycqa/flake8
27-
rev: 6.0.0
28-
hooks:
29-
- id: flake8
30-
args: [ '--max-line-length', '120', '--max-doc-length', '120' ]
31-
3232
- repo: https://github.com/asottile/blacken-docs
3333
rev: 1.13.0
3434
hooks:

.vscode/settings.json

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,7 @@
11
{
22
"python.linting.enabled": true,
3-
"python.linting.flake8Enabled": true,
3+
"python.linting.flake8Enabled": false,
44
"python.linting.pylintEnabled": false,
5-
"python.linting.flake8Path": "${workspaceFolder}/.venv/bin/flake8",
65
"python.testing.pytestArgs": [
76
"tests"
87
],

pyproject.toml

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -88,3 +88,35 @@ markers = [
8888
[tool.mypy]
8989
files = ["pytest_httpserver", "scripts", "tests", "doc"]
9090
implicit_reexport = false
91+
92+
93+
[tool.black]
94+
line-length = 120
95+
safe = true
96+
97+
[tool.ruff]
98+
select = ["ALL"]
99+
ignore = [
100+
"I",
101+
"D",
102+
"ANN",
103+
"PLR0913",
104+
"UP032",
105+
"TRY003",
106+
"FBT002",
107+
"PLR0912",
108+
"C901",
109+
"SIM108",
110+
"EM101",
111+
"B904",
112+
"TRY200",
113+
"RET505",
114+
"EM103",
115+
"COM812",
116+
"RET506",
117+
"PGH003",
118+
"S101",
119+
]
120+
line-length = 120
121+
target-version = "py38"
122+
exclude = ["doc", "example*.py"]

0 commit comments

Comments
 (0)