From a873edc708885c4c2f0db6f01f95be0e76335ba4 Mon Sep 17 00:00:00 2001 From: springbok <96668470+sprngbk@users.noreply.github.com> Date: Wed, 9 Apr 2025 05:23:58 +0000 Subject: [PATCH 1/2] initial commit --- .github/workflows/python-checks.yaml | 55 ++++++++++++++++++++++++++++ README.md | 0 pyproject.toml | 19 ++++++++++ src/pre_commit_test/__init__.py | 0 tests/__init__.py | 0 5 files changed, 74 insertions(+) create mode 100644 .github/workflows/python-checks.yaml create mode 100644 README.md create mode 100644 pyproject.toml create mode 100644 src/pre_commit_test/__init__.py create mode 100644 tests/__init__.py diff --git a/.github/workflows/python-checks.yaml b/.github/workflows/python-checks.yaml new file mode 100644 index 0000000..a968533 --- /dev/null +++ b/.github/workflows/python-checks.yaml @@ -0,0 +1,55 @@ +name: CI + +on: + push: + branches: [ main ] + pull_request: + branches: [ main ] + +jobs: + format: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - name: Set up Python 3.12.8 + uses: actions/setup-python@v5 + with: + python-version: '3.12.8' + - name: Install Black + run: pip install black + - name: Apply Black formatting + run: black . + - name: Commit formatting changes + run: | + git config --local user.email "action@github.com" + git config --local user.name "GitHub Action" + git add -A + git commit -m "Apply Black formatting" || echo "No changes to commit" + + lint: + needs: format + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - name: Set up Python 3.12.8 + uses: actions/setup-python@v5 + with: + python-version: '3.12.8' + - name: Install Ruff + run: pip install ruff + - name: Run Ruff linting + run: ruff check . + + typecheck: + needs: format + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - name: Set up Python 3.12.8 + uses: actions/setup-python@v5 + with: + python-version: '3.12.8' + - name: Install mypy + run: pip install mypy + - name: Run type checks + run: mypy . diff --git a/README.md b/README.md new file mode 100644 index 0000000..e69de29 diff --git a/pyproject.toml b/pyproject.toml new file mode 100644 index 0000000..801b1dd --- /dev/null +++ b/pyproject.toml @@ -0,0 +1,19 @@ +[project] +name = "pre-commit-test" +version = "0.1.0" +description = "" +authors = [ + {name = "springbok",email = "96668470+sprngbk@users.noreply.github.com"} +] +readme = "README.md" +requires-python = ">=3.12" +dependencies = [ +] + +[tool.poetry] +packages = [{include = "pre_commit_test", from = "src"}] + + +[build-system] +requires = ["poetry-core>=2.0.0,<3.0.0"] +build-backend = "poetry.core.masonry.api" diff --git a/src/pre_commit_test/__init__.py b/src/pre_commit_test/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/tests/__init__.py b/tests/__init__.py new file mode 100644 index 0000000..e69de29 From d959c5221a151a29a85843a139045761497a7928 Mon Sep 17 00:00:00 2001 From: springbok <96668470+sprngbk@users.noreply.github.com> Date: Wed, 9 Apr 2025 05:39:05 +0000 Subject: [PATCH 2/2] add test ci code --- test-ci.py | 5 +++++ 1 file changed, 5 insertions(+) create mode 100644 test-ci.py diff --git a/test-ci.py b/test-ci.py new file mode 100644 index 0000000..6458eb4 --- /dev/null +++ b/test-ci.py @@ -0,0 +1,5 @@ +def greet(name: int) -> str: + print("Hello, " + name + "!") + return 42 + +greet("world")