Skip to content

Commit e286126

Browse files
chore(dev): add development helper scripts
Add Makefile with common commands for building, testing and running. Create setup.sh script for easy developer onboarding. Configure git hooks for pre-commit checks. 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
1 parent 6f07022 commit e286126

File tree

2 files changed

+107
-0
lines changed

2 files changed

+107
-0
lines changed

Makefile

Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
.PHONY: help install test lint format clean run build docker-build docker-run
2+
3+
# Help command
4+
help:
5+
@echo "BINGO Application Makefile Commands"
6+
@echo ""
7+
@echo "Usage:"
8+
@echo " make install - Install dependencies"
9+
@echo " make run - Run the application"
10+
@echo " make test - Run tests"
11+
@echo " make lint - Run linters"
12+
@echo " make format - Format code"
13+
@echo " make clean - Clean build artifacts and cache"
14+
@echo " make build - Build the package"
15+
@echo " make docker-build - Build Docker image"
16+
@echo " make docker-run - Run Docker container"
17+
18+
# Install dependencies
19+
install:
20+
poetry install
21+
22+
# Run application
23+
run:
24+
poetry run python app.py
25+
26+
# Run tests
27+
test:
28+
poetry run pytest --cov=src
29+
30+
# Run lints
31+
lint:
32+
poetry run flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics
33+
poetry run flake8 . --count --exit-zero --max-complexity=10 --max-line-length=88 --statistics
34+
poetry run black --check .
35+
poetry run isort --check .
36+
37+
# Format code
38+
format:
39+
poetry run black .
40+
poetry run isort .
41+
42+
# Clean build artifacts and cache
43+
clean:
44+
rm -rf dist
45+
rm -rf .pytest_cache
46+
rm -rf .coverage
47+
find . -type d -name "__pycache__" -exec rm -rf {} +
48+
49+
# Build package
50+
build:
51+
poetry build
52+
53+
# Docker commands
54+
docker-build:
55+
docker build -t bingo .
56+
57+
docker-run:
58+
docker run -p 8080:8080 bingo

setup.sh

Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
#!/bin/bash
2+
set -e
3+
4+
# Colors for output
5+
GREEN='\033[0;32m'
6+
YELLOW='\033[0;33m'
7+
NC='\033[0m' # No Color
8+
9+
echo -e "${GREEN}Setting up bingo development environment...${NC}"
10+
11+
# Check if Poetry is installed
12+
if ! command -v poetry &> /dev/null; then
13+
echo -e "${YELLOW}Poetry not found. Installing poetry...${NC}"
14+
curl -sSL https://install.python-poetry.org | python3 -
15+
fi
16+
17+
# Install dependencies
18+
echo -e "${GREEN}Installing dependencies...${NC}"
19+
poetry install
20+
21+
# Set up pre-commit hooks
22+
echo -e "${GREEN}Setting up git hooks...${NC}"
23+
cat > .git/hooks/pre-commit << 'EOF'
24+
#!/bin/bash
25+
set -e
26+
27+
# Run black
28+
echo "Running black..."
29+
poetry run black .
30+
31+
# Run isort
32+
echo "Running isort..."
33+
poetry run isort .
34+
35+
# Run flake8
36+
echo "Running flake8..."
37+
poetry run flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics
38+
poetry run flake8 . --count --exit-zero --max-complexity=10 --max-line-length=88 --statistics
39+
40+
# Run tests
41+
echo "Running tests..."
42+
poetry run pytest
43+
EOF
44+
45+
chmod +x .git/hooks/pre-commit
46+
47+
echo -e "${GREEN}Setup complete! You're ready to start developing.${NC}"
48+
echo -e "${GREEN}Run 'poetry shell' to activate the virtual environment${NC}"
49+
echo -e "${GREEN}Run 'python app.py' to start the application${NC}"

0 commit comments

Comments
 (0)