Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,7 @@ Thumbs.db
research/
fixtures/generated/
.ruff_cache/
.secrets.baseline

# Merge artifacts and cache (added by workspace stabilization)
*.pyc
Expand Down
8 changes: 7 additions & 1 deletion AGENTS.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ Key directories:
- `tests/` — Test suite
- `.github/workflows/` — CI/CD (auto-code-review.yml, ci.yml, pages.yml, publish.yml)
- `dist/` — Built distributions
- `scripts/` — Automation scripts

## Conventions
- Language: Python 3.10+
Expand All @@ -26,4 +27,9 @@ Key directories:
- Package layout: src/ layout
- Dependencies: click, rich, pyyaml, tomli, jinja2
- CLI entry point: deploydiff.cli:cli
- Default branch: main
- Default branch: main
- Versioning: Semantic versioning (semver)
- Documentation: Markdown

## Contributing
See [CONTRIBUTING.md](CONTRIBUTING.md) for detailed contribution guidelines and development workflow.
3 changes: 1 addition & 2 deletions src/deploydiff/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -252,8 +252,7 @@ def mcp() -> None:
from .mcp_server import run_for_app
except ImportError as exc:
console.print(
"[red]Error: click-to-mcp is not installed.[/red]\n"
"Install it with: [bold]pip install click-to-mcp[/bold]"
"[red]Error: click-to-mcp is not installed.[/red]\nInstall it with: [bold]pip install click-to-mcp[/bold]"
)
raise SystemExit(1) from exc

Expand Down
2 changes: 1 addition & 1 deletion src/deploydiff/cost_estimator.py
Original file line number Diff line number Diff line change
Expand Up @@ -247,7 +247,7 @@ def _load_pricing(
if not path.exists():
return DEFAULT_PRICING.copy()

with open(path) as f:
with path.open() as f:
custom = json.load(f)

# Merge with defaults (custom overrides)
Expand Down
6 changes: 2 additions & 4 deletions src/deploydiff/mcp_server.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,7 @@ def run_mcp() -> None:
import sys

print(
"Error: click-to-mcp is not installed. "
"Install it with: pip install click-to-mcp",
"Error: click-to-mcp is not installed. Install it with: pip install click-to-mcp",
file=sys.stderr,
)
sys.exit(1)
Expand All @@ -38,8 +37,7 @@ def run_for_app(app: object) -> None:
import sys

print(
"Error: click-to-mcp is not installed. "
"Install it with: pip install click-to-mcp",
"Error: click-to-mcp is not installed. Install it with: pip install click-to-mcp",
file=sys.stderr,
)
sys.exit(1)
Expand Down
3 changes: 2 additions & 1 deletion src/deploydiff/pulumi_parser.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
from __future__ import annotations

import json
from pathlib import Path
from typing import Any

from .models import ChangeAction, ChangeSource, DeployPlan, ResourceChange
Expand Down Expand Up @@ -39,7 +40,7 @@ def parse_pulumi_preview(preview_json: str | dict[str, Any]) -> DeployPlan:
try:
data = json.loads(preview_json)
except json.JSONDecodeError:
with open(preview_json) as f:
with Path(preview_json).open() as f:
data = json.load(f)
else:
data = preview_json
Expand Down
7 changes: 3 additions & 4 deletions src/deploydiff/terraform_parser.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
from __future__ import annotations

import json
from pathlib import Path
from typing import Any

from .models import ChangeAction, ChangeSource, DeployPlan, ResourceChange
Expand Down Expand Up @@ -33,7 +34,7 @@ def parse_terraform_plan(plan_json: str | dict[str, Any]) -> DeployPlan:
data = json.loads(plan_json)
except json.JSONDecodeError:
# Try as file path
with open(plan_json) as f:
with Path(plan_json).open() as f:
data = json.load(f)
else:
data = plan_json
Expand Down Expand Up @@ -72,9 +73,7 @@ def parse_terraform_plan(plan_json: str | dict[str, Any]) -> DeployPlan:
else set()
)
after_sensitive = (
set(change.get("after_sensitive", {}).keys())
if isinstance(change.get("after_sensitive"), dict)
else set()
set(change.get("after_sensitive", {}).keys()) if isinstance(change.get("after_sensitive"), dict) else set()
)

resource_change = ResourceChange(
Expand Down
8 changes: 2 additions & 6 deletions tests/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,5 @@
@pytest.fixture(autouse=True)
def _mock_license(monkeypatch):
"""Ensure license checks stay mocked even if a test reimports."""
monkeypatch.setattr(
"revenueholdings_license.require_license", MagicMock(return_value=None)
)
monkeypatch.setattr(
"revenueholdings_license.require_tier", MagicMock(return_value=None)
)
monkeypatch.setattr("revenueholdings_license.require_license", MagicMock(return_value=None))
monkeypatch.setattr("revenueholdings_license.require_tier", MagicMock(return_value=None))
Loading