Skip to content

Commit b23774f

Browse files
author
Dev Engineer
committed
fix: ruff PTH123 violations by reviewer-B
1 parent 7e9af84 commit b23774f

5 files changed

Lines changed: 7 additions & 4 deletions

File tree

.secrets.baseline.new

Whitespace-only changes.

src/deploydiff/cloudformation_parser.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
from __future__ import annotations
44

55
import json
6+
from pathlib import Path
67
from typing import Any
78

89
from .models import ChangeAction, ChangeSource, DeployPlan, ResourceChange
@@ -41,7 +42,7 @@ def parse_cloudformation_changeset(changeset_json: str | dict[str, Any]) -> Depl
4142
try:
4243
data = json.loads(changeset_json)
4344
except json.JSONDecodeError:
44-
with open(changeset_json) as f:
45+
with Path(changeset_json).open() as f:
4546
data = json.load(f)
4647
else:
4748
data = changeset_json

src/deploydiff/cost_estimator.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -233,7 +233,7 @@ def _load_pricing(pricing_file: str | Path | None = None) -> dict[str, dict[str,
233233
if not path.exists():
234234
return DEFAULT_PRICING.copy()
235235

236-
with open(path) as f:
236+
with path.open() as f:
237237
custom = json.load(f)
238238

239239
# Merge with defaults (custom overrides)

src/deploydiff/pulumi_parser.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
from __future__ import annotations
44

55
import json
6+
from pathlib import Path
67
from typing import Any
78

89
from .models import ChangeAction, ChangeSource, DeployPlan, ResourceChange
@@ -39,7 +40,7 @@ def parse_pulumi_preview(preview_json: str | dict[str, Any]) -> DeployPlan:
3940
try:
4041
data = json.loads(preview_json)
4142
except json.JSONDecodeError:
42-
with open(preview_json) as f:
43+
with Path(preview_json).open() as f:
4344
data = json.load(f)
4445
else:
4546
data = preview_json

src/deploydiff/terraform_parser.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
from __future__ import annotations
44

55
import json
6+
from pathlib import Path
67
from typing import Any
78

89
from .models import ChangeAction, ChangeSource, DeployPlan, ResourceChange
@@ -33,7 +34,7 @@ def parse_terraform_plan(plan_json: str | dict[str, Any]) -> DeployPlan:
3334
data = json.loads(plan_json)
3435
except json.JSONDecodeError:
3536
# Try as file path
36-
with open(plan_json) as f:
37+
with Path(plan_json).open() as f:
3738
data = json.load(f)
3839
else:
3940
data = plan_json

0 commit comments

Comments
 (0)