Skip to content

Commit 828e8b9

Browse files
Add dev tooling and clean up repo config
- Add justfile with common development tasks - Add pre-commit config for code quality hooks - Remove requirements.txt (deps managed via pyproject.toml) - Update .gitignore for local/generated files
1 parent 8fcbdf6 commit 828e8b9

File tree

4 files changed

+158
-21
lines changed

4 files changed

+158
-21
lines changed

.gitignore

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,4 +54,13 @@ test_data_*
5454
# PyInstaller specific
5555
*.manifest
5656
*.spec
57-
!fileshift.spec
57+
!fileshift.spec
58+
# Claude Code
59+
.claude/settings.local.json
60+
61+
# Coverage
62+
.coverage
63+
coverage.xml
64+
65+
# Serena
66+
.serena/

.pre-commit-config.yaml

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
repos:
2+
- repo: https://github.com/pre-commit/pre-commit-hooks
3+
rev: v4.5.0
4+
hooks:
5+
- id: check-yaml
6+
- id: end-of-file-fixer
7+
- id: trailing-whitespace
8+
- id: check-added-large-files
9+
- id: check-json
10+
- id: check-merge-conflict
11+
- id: check-toml
12+
- id: debug-statements
13+
- id: mixed-line-ending
14+
15+
- repo: https://github.com/psf/black
16+
rev: 23.12.1
17+
hooks:
18+
- id: black
19+
language_version: python3.9
20+
21+
- repo: https://github.com/pycqa/isort
22+
rev: 5.13.2
23+
hooks:
24+
- id: isort
25+
args: ["--profile", "black"]
26+
27+
- repo: https://github.com/astral-sh/ruff-pre-commit
28+
rev: v0.1.9
29+
hooks:
30+
- id: ruff
31+
args: [--fix, --exit-non-zero-on-fix]
32+
33+
- repo: https://github.com/pre-commit/mirrors-mypy
34+
rev: v1.8.0
35+
hooks:
36+
- id: mypy
37+
additional_dependencies: [types-PyQt6]
38+
args: [--ignore-missing-imports]

justfile

Lines changed: 110 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,110 @@
1+
# FileShift Development Tasks
2+
3+
# Default task - show available commands
4+
default:
5+
@just --list
6+
7+
# Install project with uv
8+
install:
9+
uv pip install -e ".[dev]"
10+
11+
# Run all tests
12+
test:
13+
uv run pytest -v
14+
15+
# Run tests with coverage
16+
test-cov:
17+
uv run pytest --cov --cov-report=html --cov-report=term
18+
19+
# Run specific test file
20+
test-file FILE:
21+
uv run pytest -v {{FILE}}
22+
23+
# Run tests and watch for changes
24+
test-watch:
25+
uv run pytest-watch
26+
27+
# Format code with black and isort
28+
format:
29+
uv run black .
30+
uv run isort .
31+
uv run ruff --fix .
32+
33+
# Check code formatting
34+
check:
35+
uv run black --check .
36+
uv run isort --check-only .
37+
uv run ruff check .
38+
uv run mypy src
39+
40+
# Run type checking
41+
typecheck:
42+
uv run mypy src
43+
44+
# Clean build artifacts
45+
clean:
46+
rm -rf build dist *.egg-info
47+
rm -rf .coverage htmlcov .pytest_cache
48+
rm -rf .mypy_cache .ruff_cache
49+
find . -type d -name __pycache__ -exec rm -rf {} +
50+
find . -type f -name "*.pyc" -delete
51+
52+
# Build standalone app
53+
build:
54+
uv run pyinstaller json_to_csv_multifile_pyqt.py \
55+
--name "FileShift" \
56+
--windowed \
57+
--onefile \
58+
--icon resources/icon.ico \
59+
--add-data "src:src"
60+
61+
# Run the GUI app
62+
run:
63+
uv run python json_to_csv_multifile_pyqt.py
64+
65+
# Run the CLI
66+
run-cli *ARGS:
67+
uv run python -m src.cli {{ARGS}}
68+
69+
# Generate sample data
70+
generate-samples:
71+
uv run python generate_sample_data.py
72+
73+
# Run pre-commit hooks
74+
pre-commit:
75+
uv run pre-commit run --all-files
76+
77+
# Set up pre-commit hooks
78+
pre-commit-install:
79+
uv run pre-commit install
80+
81+
# Create a new release
82+
release VERSION:
83+
git tag -a v{{VERSION}} -m "Release version {{VERSION}}"
84+
git push origin v{{VERSION}}
85+
86+
# Run benchmarks
87+
benchmark:
88+
uv run pytest -v tests/benchmarks --benchmark-only
89+
90+
# Profile the application
91+
profile FILE:
92+
uv run python -m cProfile -o profile.stats json_to_csv_multifile_pyqt.py {{FILE}}
93+
uv run python -m pstats profile.stats
94+
95+
# Update dependencies
96+
update-deps:
97+
uv pip compile pyproject.toml -o requirements.txt --upgrade
98+
99+
# Create virtual environment with uv
100+
venv:
101+
uv venv
102+
uv pip install -e ".[dev]"
103+
104+
# Serve documentation
105+
docs-serve:
106+
uv run mkdocs serve
107+
108+
# Build documentation
109+
docs-build:
110+
uv run mkdocs build

requirements.txt

Lines changed: 0 additions & 20 deletions
This file was deleted.

0 commit comments

Comments
 (0)