This repository was archived by the owner on Jun 15, 2025. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
51 lines (42 loc) · 1.69 KB
/
Copy pathMakefile
File metadata and controls
51 lines (42 loc) · 1.69 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
# Makefile for Canvas Fingerprinting Monitor
# Define the output directory
OUTPUT_DIR = output
# Define Python code directories to lint (excluding monitor subproject)
LINT_SOURCE = main.py canvas_fingerprint_monitor
# Default target
.PHONY: all
all: help
# Help message
.PHONY: help
help:
@echo "Available targets:"
@echo " clean - Clean the output directory (preserves .gitkeep files)"
@echo " js_build - Build JavaScript bundle for production"
@echo " help - Show this help message"
# Clean target - removes all files from output directory except .gitkeep files
.PHONY: clean
clean:
@echo "Cleaning output directory..."
@powershell -Command "Get-ChildItem -Path '$(OUTPUT_DIR)' -File | Where-Object { \$$_.Name -ne '.gitkeep' } | Remove-Item -Force"
@powershell -Command "Get-ChildItem -Path '$(OUTPUT_DIR)\images' -File | Where-Object { \$$_.Name -ne '.gitkeep' } | Remove-Item -Force"
@echo "Output directory cleaned successfully."
# Check code for style issues without fixing them
lint:
docformatter --config pyproject.toml --black --check --recursive $(LINT_SOURCE) || echo ""
poetry run black --check $(LINT_SOURCE)
poetry run isort --check $(LINT_SOURCE)
poetry run flake8 $(LINT_SOURCE)
poetry run pylint $(LINT_SOURCE)
poetry run mypy $(LINT_SOURCE)
# Automatically fix code style issues
lint_fix:
docformatter --config pyproject.toml --black --in-place --recursive $(LINT_SOURCE) || echo ""
poetry run black $(LINT_SOURCE)
poetry run isort $(LINT_SOURCE)
# JavaScript targets
.PHONY: js_build
# Build JavaScript bundle for production
js_build:
@echo "Building JavaScript bundle for production..."
@cd monitor && $(MAKE) build
@echo "JavaScript bundle built successfully."