pforge-cli 0.1.0__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- pforge_cli-0.1.0.dist-info/METADATA +142 -0
- pforge_cli-0.1.0.dist-info/RECORD +20 -0
- pforge_cli-0.1.0.dist-info/WHEEL +4 -0
- pforge_cli-0.1.0.dist-info/entry_points.txt +3 -0
- project_forge/__init__.py +6 -0
- project_forge/bumper.py +514 -0
- project_forge/changelog.py +184 -0
- project_forge/cli.py +386 -0
- project_forge/commits.py +594 -0
- project_forge/config.py +101 -0
- project_forge/doctor.py +132 -0
- project_forge/documentation.py +280 -0
- project_forge/hooks.py +198 -0
- project_forge/process.py +126 -0
- project_forge/project.py +148 -0
- project_forge/publishing.py +134 -0
- project_forge/pull_requests.py +259 -0
- project_forge/quality.py +477 -0
- project_forge/releases.py +173 -0
- project_forge/status.py +65 -0
project_forge/status.py
ADDED
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
"""Fast project status dashboard display."""
|
|
2
|
+
|
|
3
|
+
from __future__ import annotations
|
|
4
|
+
|
|
5
|
+
from pathlib import Path
|
|
6
|
+
|
|
7
|
+
from rich.console import Console
|
|
8
|
+
from rich.table import Table
|
|
9
|
+
|
|
10
|
+
from project_forge.changelog import get_latest_release
|
|
11
|
+
from project_forge.config import load_config
|
|
12
|
+
from project_forge.hooks import get_hooks_status
|
|
13
|
+
from project_forge.process import run_process
|
|
14
|
+
from project_forge.project import (
|
|
15
|
+
find_project_root,
|
|
16
|
+
get_dirty_files,
|
|
17
|
+
get_git_branch,
|
|
18
|
+
read_project_metadata,
|
|
19
|
+
)
|
|
20
|
+
|
|
21
|
+
console = Console()
|
|
22
|
+
|
|
23
|
+
|
|
24
|
+
def show_status(root_dir: Path | None = None) -> int:
|
|
25
|
+
"""Print a clean dashboard overview of repository status."""
|
|
26
|
+
if root_dir is None:
|
|
27
|
+
root_dir = find_project_root()
|
|
28
|
+
|
|
29
|
+
cfg = load_config(root_dir)
|
|
30
|
+
metadata = read_project_metadata(root_dir)
|
|
31
|
+
branch = get_git_branch(root_dir)
|
|
32
|
+
dirty = get_dirty_files(root_dir)
|
|
33
|
+
hooks = get_hooks_status(root_dir)
|
|
34
|
+
latest_rel = get_latest_release(root_dir / cfg.changelog)
|
|
35
|
+
|
|
36
|
+
gh_res = run_process(["gh", "auth", "status"], cwd=root_dir)
|
|
37
|
+
gh_status = (
|
|
38
|
+
"[green]Authenticated[/green]"
|
|
39
|
+
if gh_res.passed
|
|
40
|
+
else "[yellow]Unauthenticated/Missing[/yellow]"
|
|
41
|
+
)
|
|
42
|
+
|
|
43
|
+
table = Table(title="Project Forge Status", show_header=True, header_style="bold magenta")
|
|
44
|
+
table.add_column("Property", style="bold")
|
|
45
|
+
table.add_column("Value")
|
|
46
|
+
|
|
47
|
+
table.add_row("Project Name", metadata.get("name", root_dir.name))
|
|
48
|
+
table.add_row("Project Version", f"[bold green]{metadata.get('version')}[/bold green]")
|
|
49
|
+
table.add_row("Repository Root", str(root_dir))
|
|
50
|
+
table.add_row("Git Branch", f"[cyan]{branch}[/cyan]")
|
|
51
|
+
dirty_color = "green" if len(dirty) == 0 else "yellow"
|
|
52
|
+
table.add_row("Working Tree", f"[{dirty_color}]{len(dirty)} dirty files[/{dirty_color}]")
|
|
53
|
+
table.add_row("Quality Fast Tier", ", ".join(cfg.quality.fast))
|
|
54
|
+
table.add_row("Quality Full Tier", ", ".join(cfg.quality.full))
|
|
55
|
+
hooks_color = "green" if hooks["installed"] else "yellow"
|
|
56
|
+
table.add_row(
|
|
57
|
+
"Git Hooks",
|
|
58
|
+
f"[{hooks_color}]{'Installed' if hooks['installed'] else 'Not Installed'}[/{hooks_color}]",
|
|
59
|
+
)
|
|
60
|
+
table.add_row("GitHub CLI", gh_status)
|
|
61
|
+
latest_ver_str = latest_rel.version if latest_rel else "(none)"
|
|
62
|
+
table.add_row("Changelog Latest", f"[bold cyan]{latest_ver_str}[/bold cyan]")
|
|
63
|
+
|
|
64
|
+
console.print(table)
|
|
65
|
+
return 0
|