From 60a6ee5d78abf545526e8c3bf5fa2875f8336f1f Mon Sep 17 00:00:00 2001 From: Jackson Ferguson Date: Tue, 3 Mar 2026 16:52:00 -0800 Subject: [PATCH 1/4] chore: bump pre-commit hooks - Update ruff-pre-commit to v0.15.4 - Update markdownlint-cli to v0.48.0 --- .pre-commit-config.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index d495eb1..2d04e27 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -12,7 +12,7 @@ repos: # 2. Python-specific toolchain - repo: https://github.com/astral-sh/ruff-pre-commit - rev: v0.14.11 + rev: v0.15.4 hooks: - id: ruff-format - id: ruff @@ -25,7 +25,7 @@ repos: # 3. Markdown linting - repo: https://github.com/igorshubovych/markdownlint-cli - rev: v0.47.0 + rev: v0.48.0 hooks: - id: markdownlint args: ["--fix"] # Automatically resolves formatting deviations From 326abcfb47c1fb3022e60cc8044deed80b06d4d5 Mon Sep 17 00:00:00 2001 From: Jackson Ferguson Date: Tue, 3 Mar 2026 16:52:29 -0800 Subject: [PATCH 2/4] fix(docs): correct repository URL in issue template config Updates contact_links URL to point to the correct jacksonfergusondev namespace. --- .github/ISSUE_TEMPLATE/config.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/ISSUE_TEMPLATE/config.yml b/.github/ISSUE_TEMPLATE/config.yml index bc46299..2c962ae 100644 --- a/.github/ISSUE_TEMPLATE/config.yml +++ b/.github/ISSUE_TEMPLATE/config.yml @@ -1,5 +1,5 @@ blank_issues_enabled: false contact_links: - name: GitHub Discussions - url: https://github.com/jacksonferguson/git-pulsar/discussions + url: https://github.com/jacksonfergusondev/git-pulsar/discussions about: Please ask questions and discuss ideas here before opening an issue. From 54518938d5de7cc3a698fdce8c33b4a66d2e0c26 Mon Sep 17 00:00:00 2001 From: Jackson Ferguson Date: Tue, 3 Mar 2026 16:52:40 -0800 Subject: [PATCH 3/4] build: enforce Google style docstrings and improve mypy strictness - Update pyproject.toml to include ruff 'D' (pydocstyle) rules with Google convention. - Resolve resulting D205 formatting errors in cli.py and git_wrapper.py. - Enable verbose output and error context for mypy. --- pyproject.toml | 18 +++++++++++++++--- src/git_pulsar/cli.py | 7 +++---- src/git_pulsar/git_wrapper.py | 5 +---- src/git_pulsar/ops.py | 3 +-- 4 files changed, 20 insertions(+), 13 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index 9699050..0929ab4 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -69,18 +69,27 @@ exclude = [ # T20: Print (prevents accidentally leaving print() in CLI tools) # PT: Pytest style # C4: Comprehensions (better list/dict comp usage) -select = ["E", "F", "I", "B", "UP", "SIM", "T20", "PT", "C4"] -ignore = ["E501"] # Line length handled by formatter +# D: Docstrings +select = ["E", "F", "I", "B", "UP", "SIM", "T20", "PT", "C4", "D"] +ignore = [ + "E501", + "D100", # Missing docstring in public module + "D104", # Missing docstring in public package + "D107", # Missing docstring in __init__ +] # Allow ignored variables (e.g. for unpacking) dummy-variable-rgx = "^(_+|(_+[a-zA-Z0-9_]*[a-zA-Z0-9]+?))$" +[tool.ruff.lint.pydocstyle] +convention = "google" + [tool.ruff.lint.isort] known-first-party = ["git_pulsar"] section-order = ["future", "standard-library", "third-party", "first-party", "local-folder"] [tool.ruff.lint.per-file-ignores] -"tests/*.py" = ["T201"] +"tests/*.py" = ["T201", "D"] [tool.ruff.format] quote-style = "double" @@ -90,6 +99,9 @@ line-ending = "auto" [tool.mypy] python_version = "3.12" +pretty = true +show_error_codes = true +show_error_context = true warn_return_any = true warn_unused_configs = true check_untyped_defs = true diff --git a/src/git_pulsar/cli.py b/src/git_pulsar/cli.py index 067f2ff..18200b5 100644 --- a/src/git_pulsar/cli.py +++ b/src/git_pulsar/cli.py @@ -60,8 +60,7 @@ def _get_ref(repo: GitRepo) -> str: def _analyze_logs(seconds: int = 86400) -> list[str]: - """ - Scans the daemon log for error messages that occurred within a recent time window. + """Scans the daemon log for error messages that occurred within a recent time window. Args: seconds (int, optional): The number of seconds to look back. Defaults to 86400 (24h). @@ -499,8 +498,8 @@ def _check_git_hooks(repo_path: Path) -> list[str]: def run_doctor() -> None: - """ - Diagnoses system health, cleans the registry, and checks connectivity and logs. + """Diagnoses system health, cleans the registry, and checks connectivity and logs. + Includes an interactive resolution queue for safe auto-fixes. """ console.print("[bold]Pulsar Doctor[/bold]\n") diff --git a/src/git_pulsar/git_wrapper.py b/src/git_pulsar/git_wrapper.py index 5474037..869ab7c 100644 --- a/src/git_pulsar/git_wrapper.py +++ b/src/git_pulsar/git_wrapper.py @@ -132,10 +132,7 @@ def commit(self, message: str, no_verify: bool = False) -> None: self._run(cmd, capture=False) def add_all(self) -> None: - """ - Stages all changes (modified, deleted, and untracked files) - in the working directory. - """ + """Stages all changes (modified, deleted, and untracked files) in the working directory.""" self._run(["add", "."], capture=False) def merge_squash(self, *branches: str) -> None: diff --git a/src/git_pulsar/ops.py b/src/git_pulsar/ops.py index b14ae2f..6cb87d6 100644 --- a/src/git_pulsar/ops.py +++ b/src/git_pulsar/ops.py @@ -22,8 +22,7 @@ def get_backup_ref(branch: str) -> str: - """ - Constructs the fully qualified backup reference for the current machine and branch. + """Constructs the fully qualified backup reference for the current machine and branch. Args: branch (str): The name of the branch to back up. From 73dc9238f165e604d73273403ec40c544f2cc782 Mon Sep 17 00:00:00 2001 From: Jackson Ferguson Date: Tue, 3 Mar 2026 16:53:33 -0800 Subject: [PATCH 4/4] feat(cli): add --version flag Implements standard argparse versioning using importlib.metadata to dynamically pull the package version from the installed wheel/sdist. --- src/git_pulsar/cli.py | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/git_pulsar/cli.py b/src/git_pulsar/cli.py index 18200b5..c0d72f1 100644 --- a/src/git_pulsar/cli.py +++ b/src/git_pulsar/cli.py @@ -1,5 +1,6 @@ import argparse import datetime +import importlib.metadata import logging import os import subprocess @@ -1116,6 +1117,14 @@ def main() -> None: help=argparse.SUPPRESS, ) + # Add the version flag here + parser.add_argument( + "--version", + action="version", + version=f"%(prog)s {importlib.metadata.version('git-pulsar')}", + help="Show the application version and exit.", + ) + # Global flags subparsers = parser.add_subparsers(