Skip to content

Commit

Permalink
clean added to makefile, small refactoring (#11)
Browse files Browse the repository at this point in the history
Co-authored-by: James <[email protected]>
  • Loading branch information
jameslawlor and James authored Dec 28, 2023
1 parent 44e287e commit 16a0d82
Showing 1 changed file with 13 additions and 1 deletion.
14 changes: 13 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
@@ -1,14 +1,26 @@
all: black flake test solutions
.PHONY: all clean black flake test solutions

# Default target
all: black flake test solutions clean

# Clean temporary and generated files
clean:
find . \( -type f -name '*.pyc' -or -type d -name '__pycache__' \) -delete
find . \( -type d -name '.eggs' -or -type d -name '*.egg-info' -or -type d -name '.pytest_cache' \) | xargs rm -rf

# Format code using black
black:
black ./src ./tests

# Run flake8 for linting
flake:
flake8 ./src ./tests

# Run tests
test:
python3 -m pytest

# Run specific solutions for Advent of Code 2023
solutions:
python3 src/aoc_2023/days/1.py --input_file inputs/1.txt --part 1
python3 src/aoc_2023/days/1.py --input_file inputs/1.txt --part 2
Expand Down

0 comments on commit 16a0d82

Please sign in to comment.