From bcfdc9b655627a2c6054f476a35c5c3dd3eb55f6 Mon Sep 17 00:00:00 2001 From: CoderDeltaLAN Date: Wed, 10 Sep 2025 00:40:18 +0100 Subject: [PATCH 1/6] fix: apply ruff/black; remove unused import to keep lint green --- src/commit_guardian/__init__.py | 1 + src/commit_guardian/cli.py | 3 ++- tests/test_sanity.py | 1 + 3 files changed, 4 insertions(+), 1 deletion(-) diff --git a/src/commit_guardian/__init__.py b/src/commit_guardian/__init__.py index 61d8083..18a159d 100644 --- a/src/commit_guardian/__init__.py +++ b/src/commit_guardian/__init__.py @@ -1,5 +1,6 @@ __all__ = ["ping", "__version__"] __version__ = "0.1.0" + def ping() -> str: return "pong" diff --git a/src/commit_guardian/cli.py b/src/commit_guardian/cli.py index 1841125..2e95176 100644 --- a/src/commit_guardian/cli.py +++ b/src/commit_guardian/cli.py @@ -1,8 +1,8 @@ from __future__ import annotations -import sys import click from . import __version__, ping + @click.command() @click.option("--version", is_flag=True, help="Show version and exit.") def main(version: bool) -> None: @@ -12,5 +12,6 @@ def main(version: bool) -> None: click.echo(ping()) raise SystemExit(0) + if __name__ == "__main__": main() diff --git a/tests/test_sanity.py b/tests/test_sanity.py index 3d243a5..1963bc1 100644 --- a/tests/test_sanity.py +++ b/tests/test_sanity.py @@ -1,4 +1,5 @@ import commit_guardian as cg + def test_ping() -> None: assert cg.ping() == "pong" From fa0f7751e492382adb72f5f984c7b733994fdd91 Mon Sep 17 00:00:00 2001 From: CoderDeltaLAN Date: Wed, 10 Sep 2025 00:44:34 +0100 Subject: [PATCH 2/6] ci: restore linux job names and set PYTHONPATH=src (keep windows optional) --- .github/workflows/ci.yml | 26 +++++++++++++++++++++++--- 1 file changed, 23 insertions(+), 3 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index ef6a2ab..ff66d9b 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -13,13 +13,15 @@ concurrency: cancel-in-progress: true jobs: - python: - if: ${{ (github.event_name == 'push' && startsWith(github.ref,'refs/heads/main')) || (github.event_name == 'pull_request' && github.event.pull_request.draft == false && contains(github.event.pull_request.labels.*.name,'ready')) }} + linux: + name: linux (py=${{ matrix.python-version }}) runs-on: ubuntu-latest strategy: fail-fast: false matrix: - python-version: ['3.11','3.12'] + python-version: ["3.11","3.12"] + env: + PYTHONPATH: src steps: - uses: actions/checkout@v4 - uses: actions/setup-python@v5 @@ -31,3 +33,21 @@ jobs: - run: black --check . - run: pytest -q - run: mypy . + + windows_optional: + name: windows (optional) + runs-on: windows-latest + continue-on-error: true + env: + PYTHONPATH: src + steps: + - uses: actions/checkout@v4 + - uses: actions/setup-python@v5 + with: + python-version: "3.12" + - run: python -m pip install -U pip + - run: pip install ruff black pytest mypy + - run: ruff check . + - run: black --check . + - run: pytest -q + - run: mypy . From 37fbbb5f889ff6dbfb31e24c136aeda50c49a8b4 Mon Sep 17 00:00:00 2001 From: CoderDeltaLAN Date: Wed, 10 Sep 2025 00:56:38 +0100 Subject: [PATCH 3/6] ci: retrigger on new base From a2c6592766d4acb8b6df6d14f3fcc0cee31349a4 Mon Sep 17 00:00:00 2001 From: Yosvel <152043745+CoderDeltaLAN@users.noreply.github.com> Date: Wed, 10 Sep 2025 01:29:51 +0100 Subject: [PATCH 4/6] fix: remove unused import and format code to keep lint green (#7) * fix: remove unused import and format code to keep lint green * ci: retrigger on new base (CI fixed branch) --------- Co-authored-by: CoderDeltaLAN From c1b17cbec0aa4dbdf3c4cb6e298e34e4ce653610 Mon Sep 17 00:00:00 2001 From: Yosvel <152043745+CoderDeltaLAN@users.noreply.github.com> Date: Wed, 10 Sep 2025 01:41:12 +0100 Subject: [PATCH 5/6] fix: remove unused import and format code to keep main green (#8) * fix: remove unused import and format code to keep main green * ci: retrigger on fixed CI base --------- Co-authored-by: CoderDeltaLAN From d9919759237debf3953b0f83e9a7e9aba24dd599 Mon Sep 17 00:00:00 2001 From: Yosvel <152043745+CoderDeltaLAN@users.noreply.github.com> Date: Wed, 10 Sep 2025 02:16:29 +0100 Subject: [PATCH 6/6] fix: remove unused import and format code to keep main green (#9) Co-authored-by: CoderDeltaLAN