From d213abf9d9309e54871e84a0723db2a86d60752d Mon Sep 17 00:00:00 2001 From: Petru Paler Date: Sat, 27 Dec 2025 17:41:32 +0000 Subject: [PATCH] chore: add pre-commit hook with ruff and pytest MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Add git pre-commit hook running ruff check, ruff format, pytest - Fix import ordering in conftest.py - Add placeholder test for test infrastructure - Generate flake.lock 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 --- flake.lock | 27 +++++++++++++++++++++++++++ src/animaltrack/cli.py | 8 ++------ tests/conftest.py | 5 +++-- tests/test_placeholder.py | 7 +++++++ 4 files changed, 39 insertions(+), 8 deletions(-) create mode 100644 flake.lock create mode 100644 tests/test_placeholder.py diff --git a/flake.lock b/flake.lock new file mode 100644 index 0000000..4abe429 --- /dev/null +++ b/flake.lock @@ -0,0 +1,27 @@ +{ + "nodes": { + "nixpkgs": { + "locked": { + "lastModified": 1766807290, + "narHash": "sha256-7sgUQMKMDvpeu9cwE7mWJfP9N3wJduunmJ/s8LOd9nk=", + "owner": "NixOS", + "repo": "nixpkgs", + "rev": "4eec65df50d796a8fd9c146a09b5007916ce376b", + "type": "github" + }, + "original": { + "owner": "NixOS", + "ref": "nixpkgs-unstable", + "repo": "nixpkgs", + "type": "github" + } + }, + "root": { + "inputs": { + "nixpkgs": "nixpkgs" + } + } + }, + "root": "root", + "version": 7 +} diff --git a/src/animaltrack/cli.py b/src/animaltrack/cli.py index 7839a06..b9965d3 100644 --- a/src/animaltrack/cli.py +++ b/src/animaltrack/cli.py @@ -15,14 +15,10 @@ def main(): # migrate command migrate_parser = subparsers.add_parser("migrate", help="Run database migrations") - migrate_parser.add_argument( - "--to", type=str, help="Migrate to specific version", default=None - ) + migrate_parser.add_argument("--to", type=str, help="Migrate to specific version", default=None) # create-migration command - create_parser = subparsers.add_parser( - "create-migration", help="Create a new migration file" - ) + create_parser = subparsers.add_parser("create-migration", help="Create a new migration file") create_parser.add_argument("description", help="Description for the migration") # seed command diff --git a/tests/conftest.py b/tests/conftest.py index 5f22522..97aa702 100644 --- a/tests/conftest.py +++ b/tests/conftest.py @@ -1,9 +1,10 @@ # ABOUTME: Pytest configuration and fixtures for AnimalTrack tests. # ABOUTME: Provides database fixtures, test clients, and common utilities. -import pytest -import tempfile import os +import tempfile + +import pytest @pytest.fixture diff --git a/tests/test_placeholder.py b/tests/test_placeholder.py new file mode 100644 index 0000000..ad7d3ea --- /dev/null +++ b/tests/test_placeholder.py @@ -0,0 +1,7 @@ +# ABOUTME: Placeholder test to ensure test infrastructure works. +# ABOUTME: Remove once real tests are added. + + +def test_placeholder(): + """Placeholder test - remove when real tests exist.""" + assert True