From 401a081419c8c150217dc9c48c11c06238ff3dd0 Mon Sep 17 00:00:00 2001 From: VasilevNStas Date: Thu, 25 Jun 2026 20:31:12 +0300 Subject: [PATCH] chore: Makefile + pre-commit hook - Makefile: check, test, lint, build, clean, install, install-rich - pre-commit hook (.githooks/pre-commit): ruff check on every commit - make install sets core.hooksPath automatically --- .githooks/pre-commit | 2 ++ Makefile | 24 ++++++++++++++++++++++++ 2 files changed, 26 insertions(+) create mode 100755 .githooks/pre-commit create mode 100644 Makefile diff --git a/.githooks/pre-commit b/.githooks/pre-commit new file mode 100755 index 0000000..c5da235 --- /dev/null +++ b/.githooks/pre-commit @@ -0,0 +1,2 @@ +#!/bin/sh +exec python -m ruff check "$@" diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..9a77abc --- /dev/null +++ b/Makefile @@ -0,0 +1,24 @@ +.PHONY: check test lint build clean install install-rich + +check: lint test + +test: + python -m pytest tests/ -q + +lint: + python -m ruff check . + +build: clean + python -m build + +clean: + rm -rf dist/ build/ *.egg-info __pycache__ .ruff_cache .pytest_cache + find . -type d -name __pycache__ -exec rm -rf {} + 2>/dev/null || true + +install: + pip install -e . + git config core.hooksPath .githooks + +install-rich: + pip install -e ".[rich]" + git config core.hooksPath .githooks