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
2 changes: 1 addition & 1 deletion .github/ISSUE_TEMPLATE/config.yml
Original file line number Diff line number Diff line change
@@ -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.
4 changes: 2 additions & 2 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
18 changes: 15 additions & 3 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand All @@ -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
Expand Down
16 changes: 12 additions & 4 deletions src/git_pulsar/cli.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import argparse
import datetime
import importlib.metadata
import logging
import os
import subprocess
Expand Down Expand Up @@ -60,8 +61,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).
Expand Down Expand Up @@ -499,8 +499,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")
Expand Down Expand Up @@ -1117,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(
Expand Down
5 changes: 1 addition & 4 deletions src/git_pulsar/git_wrapper.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
3 changes: 1 addition & 2 deletions src/git_pulsar/ops.py
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down