From 5ec53b87bcd8d6557c9880de01a224793a8799c4 Mon Sep 17 00:00:00 2001 From: AJ Date: Wed, 1 Jul 2026 23:43:30 -0400 Subject: [PATCH] chore: add pyproject.toml, ruff/pytest config, pre-commit hooks, dev deps --- .gitignore | 6 +++++ .pre-commit-config.yaml | 15 +++++++++++ pyproject.toml | 57 +++++++++++++++++++++++++++++++++++++++++ requirements-dev.txt | 4 +++ 4 files changed, 82 insertions(+) create mode 100644 .pre-commit-config.yaml create mode 100644 pyproject.toml diff --git a/.gitignore b/.gitignore index cf4c94d..0ee245c 100644 --- a/.gitignore +++ b/.gitignore @@ -5,6 +5,12 @@ __pycache__/ .venv/ venv/ +# Test / lint caches +.pytest_cache/ +.ruff_cache/ +.coverage +htmlcov/ + # PyInstaller / build build/ dist/ diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml new file mode 100644 index 0000000..f549586 --- /dev/null +++ b/.pre-commit-config.yaml @@ -0,0 +1,15 @@ +# Install once with: pip install pre-commit && pre-commit install +repos: + - repo: https://github.com/astral-sh/ruff-pre-commit + rev: v0.8.4 + hooks: + - id: ruff + args: [--fix] + - id: ruff-format + - repo: https://github.com/pre-commit/pre-commit-hooks + rev: v5.0.0 + hooks: + - id: trailing-whitespace + - id: end-of-file-fixer + - id: check-yaml + - id: check-json diff --git a/pyproject.toml b/pyproject.toml new file mode 100644 index 0000000..12d09ef --- /dev/null +++ b/pyproject.toml @@ -0,0 +1,57 @@ +[project] +name = "better-claude-config" +version = "1.1.0" +description = "Cross-platform GUI for editing the mcpServers block of Claude Desktop and Claude Code configs" +readme = "README.md" +license = { file = "LICENSE" } +requires-python = ">=3.10" +dependencies = [ + "PySide6>=6.6", +] + +[project.optional-dependencies] +dev = [ + "pytest>=8.0", + "ruff>=0.6", + "pre-commit>=3.5", +] +build = [ + "pyinstaller>=6.0", + "pillow>=10.0", +] + +[project.urls] +Repository = "https://git.avezzano.io/the_og/better-claude-config" + +# --------------------------------------------------------------------------- +# Tooling +# --------------------------------------------------------------------------- +[tool.pytest.ini_options] +testpaths = ["tests"] +addopts = "-q" + +[tool.ruff] +line-length = 100 +target-version = "py310" + +[tool.ruff.lint] +select = [ + "E", # pycodestyle errors + "W", # pycodestyle warnings + "F", # pyflakes + "I", # isort + "UP", # pyupgrade + "B", # bugbear + "SIM", # simplify + "RUF", # ruff-specific +] +ignore = [ + "E501", # line length handled pragmatically; GUI strings run long + "SIM108", # ternary rewrites hurt readability in places + "RUF001", # UI strings intentionally use typographic glyphs (−, →, ↳) + "RUF002", + "RUF003", +] + +[tool.ruff.lint.per-file-ignores] +"bcc.py" = ["F405", "F403"] # Qt star-import style if ever used diff --git a/requirements-dev.txt b/requirements-dev.txt index a50d6fa..9f219d9 100644 --- a/requirements-dev.txt +++ b/requirements-dev.txt @@ -4,3 +4,7 @@ PySide6>=6.6 # Build / packaging pyinstaller>=6.0 pillow>=10.0 # generates icons/app.ico during CI (Windows build) + +# Test / lint +pytest>=8.0 +ruff>=0.6