Skip to content

Commit 683a1bd

Browse files
Enable TC rules (#364)
* Enable `TC` rules * Fix exception namespace
1 parent 622b97f commit 683a1bd

5 files changed

Lines changed: 13 additions & 9 deletions

File tree

pyproject.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -103,6 +103,7 @@ lint.select = [
103103
"PT",
104104
"RUF",
105105
"SIM",
106+
"TC",
106107
"UP",
107108
]
108109
lint.ignore = [ "D417", "PLR2004", "SIM108" ]

src/usethis/_integrations/bitbucket/steps.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
from functools import singledispatch
22
from pathlib import Path
3+
from typing import TYPE_CHECKING
34

4-
from ruamel.yaml.anchor import Anchor
55
from ruamel.yaml.comments import CommentedSeq
66
from ruamel.yaml.scalarstring import LiteralScalarString
77
from typing_extensions import assert_never
@@ -39,6 +39,9 @@
3939
from usethis._integrations.uv.python import get_supported_major_python_versions
4040
from usethis._integrations.yaml.update import update_ruamel_yaml_map
4141

42+
if TYPE_CHECKING:
43+
from ruamel.yaml.anchor import Anchor
44+
4245
_CACHE_LOOKUP = {
4346
"uv": CachePath("~/.cache/uv"),
4447
"pre-commit": CachePath("~/.cache/pre-commit"),

tests/usethis/_integrations/bitbucket/test_bitbucket_schema.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ def test_matches_schema_store(self):
2727
online_schema_json = requests.get(
2828
"https://api.bitbucket.org/schemas/pipelines-configuration"
2929
).text
30-
except ConnectionError as err:
30+
except requests.exceptions.ConnectionError as err:
3131
if os.getenv("CI"):
3232
pytest.skip(
3333
"Failed to fetch JSON schema (connection issues); skipping test"

tests/usethis/_integrations/pre_commit/test_pre_commit_schema.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ def test_matches_schema_store(self):
2929
online_schema_json = requests.get(
3030
"https://json.schemastore.org/pre-commit-config.json"
3131
).text
32-
except ConnectionError as err:
32+
except requests.exceptions.ConnectionError as err:
3333
if os.getenv("CI"):
3434
pytest.skip(
3535
"Failed to fetch JSON schema (connection issues); skipping test"

uv.lock

Lines changed: 6 additions & 6 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)