Skip to content

Commit b65b525

Browse files
improve: rebase + resolve conflicts for PR #38 (secrets baseline, lint-clean style, AGENTS.md)
Net changes after merge-conflict resolution: lint-clean style for parsers/cli/mcp_server, AGENTS.md additions, gitignore secrets baseline. .secrets.baseline already untracked on main (original PR intent met).
1 parent 5866c30 commit b65b525

8 files changed

Lines changed: 19 additions & 19 deletions

File tree

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,7 @@ Thumbs.db
7171
research/
7272
fixtures/generated/
7373
.ruff_cache/
74+
.secrets.baseline
7475

7576
# Merge artifacts and cache (added by workspace stabilization)
7677
*.pyc

AGENTS.md

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ Key directories:
1616
- `tests/` — Test suite
1717
- `.github/workflows/` — CI/CD (auto-code-review.yml, ci.yml, pages.yml, publish.yml)
1818
- `dist/` — Built distributions
19+
- `scripts/` — Automation scripts
1920

2021
## Conventions
2122
- Language: Python 3.10+
@@ -26,4 +27,9 @@ Key directories:
2627
- Package layout: src/ layout
2728
- Dependencies: click, rich, pyyaml, tomli, jinja2
2829
- CLI entry point: deploydiff.cli:cli
29-
- Default branch: main
30+
- Default branch: main
31+
- Versioning: Semantic versioning (semver)
32+
- Documentation: Markdown
33+
34+
## Contributing
35+
See [CONTRIBUTING.md](CONTRIBUTING.md) for detailed contribution guidelines and development workflow.

src/deploydiff/cli.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -252,8 +252,7 @@ def mcp() -> None:
252252
from .mcp_server import run_for_app
253253
except ImportError as exc:
254254
console.print(
255-
"[red]Error: click-to-mcp is not installed.[/red]\n"
256-
"Install it with: [bold]pip install click-to-mcp[/bold]"
255+
"[red]Error: click-to-mcp is not installed.[/red]\nInstall it with: [bold]pip install click-to-mcp[/bold]"
257256
)
258257
raise SystemExit(1) from exc
259258

src/deploydiff/cost_estimator.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -247,7 +247,7 @@ def _load_pricing(
247247
if not path.exists():
248248
return DEFAULT_PRICING.copy()
249249

250-
with open(path) as f:
250+
with path.open() as f:
251251
custom = json.load(f)
252252

253253
# Merge with defaults (custom overrides)

src/deploydiff/mcp_server.py

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,7 @@ def run_mcp() -> None:
1919
import sys
2020

2121
print(
22-
"Error: click-to-mcp is not installed. "
23-
"Install it with: pip install click-to-mcp",
22+
"Error: click-to-mcp is not installed. Install it with: pip install click-to-mcp",
2423
file=sys.stderr,
2524
)
2625
sys.exit(1)
@@ -38,8 +37,7 @@ def run_for_app(app: object) -> None:
3837
import sys
3938

4039
print(
41-
"Error: click-to-mcp is not installed. "
42-
"Install it with: pip install click-to-mcp",
40+
"Error: click-to-mcp is not installed. Install it with: pip install click-to-mcp",
4341
file=sys.stderr,
4442
)
4543
sys.exit(1)

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: 3 additions & 4 deletions
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
@@ -72,9 +73,7 @@ def parse_terraform_plan(plan_json: str | dict[str, Any]) -> DeployPlan:
7273
else set()
7374
)
7475
after_sensitive = (
75-
set(change.get("after_sensitive", {}).keys())
76-
if isinstance(change.get("after_sensitive"), dict)
77-
else set()
76+
set(change.get("after_sensitive", {}).keys()) if isinstance(change.get("after_sensitive"), dict) else set()
7877
)
7978

8079
resource_change = ResourceChange(

tests/conftest.py

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -17,9 +17,5 @@
1717
@pytest.fixture(autouse=True)
1818
def _mock_license(monkeypatch):
1919
"""Ensure license checks stay mocked even if a test reimports."""
20-
monkeypatch.setattr(
21-
"revenueholdings_license.require_license", MagicMock(return_value=None)
22-
)
23-
monkeypatch.setattr(
24-
"revenueholdings_license.require_tier", MagicMock(return_value=None)
25-
)
20+
monkeypatch.setattr("revenueholdings_license.require_license", MagicMock(return_value=None))
21+
monkeypatch.setattr("revenueholdings_license.require_tier", MagicMock(return_value=None))

0 commit comments

Comments
 (0)