Skip to content

Commit 335661f

Browse files
committed
Enable more ruff checks
1 parent 68817c4 commit 335661f

File tree

6 files changed

+28
-11
lines changed

6 files changed

+28
-11
lines changed

.vscode/extensions.json

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
{
2+
"recommendations": [
3+
"ms-python.black-formatter",
4+
"charliermarsh.ruff",
5+
"ms-python.python"
6+
]
7+
}

.vscode/settings.json

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
{
2+
"[python]": {
3+
"editor.codeActionsOnSave": {
4+
"source.fixAll": true
5+
},
6+
"editor.defaultFormatter": "ms-python.black-formatter",
7+
"editor.formatOnSave": true
8+
}
9+
}

pyproject.toml

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -174,9 +174,6 @@ ignore = [
174174
"D205",
175175
"D212",
176176
"D213",
177-
# Allow backslashes in a docstring.
178-
# See https://click.palletsprojects.com/en/8.0.x/documentation/#preventing-rewrapping.
179-
"D301",
180177
# It is too much work to make every docstring imperative.
181178
"D401",
182179
# We ignore some docstyle errors which do not apply to Google style
@@ -188,14 +185,9 @@ ignore = [
188185
"N818",
189186
# Ignore "too-many-*" errors as they seem to get in the way more than
190187
# helping.
191-
"PLR0912",
192188
"PLR0913",
193189
# Allow 'assert' as we use it for tests.
194190
"S101",
195-
# Allow imports which are only used for type checking to be outside type
196-
# checking blocks.
197-
"TCH002",
198-
"TCH003",
199191
]
200192

201193
[tool.ruff.per-file-ignores]

src/vws/query.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@
55
from __future__ import annotations
66

77
import datetime
8-
import io
98
from http import HTTPStatus
9+
from typing import TYPE_CHECKING
1010
from urllib.parse import urljoin
1111

1212
import requests
@@ -27,6 +27,9 @@
2727
from vws.include_target_data import CloudRecoIncludeTargetData
2828
from vws.reports import QueryResult, TargetData
2929

30+
if TYPE_CHECKING:
31+
import io
32+
3033

3134
class CloudRecoService:
3235
"""

src/vws/vws.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,10 @@
55
from __future__ import annotations
66

77
import base64
8-
import io
98
import json
109
from datetime import date
1110
from time import sleep
11+
from typing import TYPE_CHECKING
1212
from urllib.parse import urljoin
1313

1414
import requests
@@ -47,6 +47,9 @@
4747
TargetSummaryReport,
4848
)
4949

50+
if TYPE_CHECKING:
51+
import io
52+
5053

5154
def _target_api_request(
5255
server_access_key: str,

tests/test_vws.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,9 @@
66

77
import base64
88
import datetime
9-
import io
109
import random
1110
import uuid
11+
from typing import TYPE_CHECKING
1212

1313
import pytest
1414
from freezegun import freeze_time
@@ -23,6 +23,9 @@
2323
TargetSummaryReport,
2424
)
2525

26+
if TYPE_CHECKING:
27+
import io
28+
2629

2730
class TestAddTarget:
2831
"""

0 commit comments

Comments
 (0)