-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathjustfile
More file actions
140 lines (121 loc) · 3.55 KB
/
Copy pathjustfile
File metadata and controls
140 lines (121 loc) · 3.55 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
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
# ©AngelaMos | 2026
# justfile
set dotenv-load
set export
set shell := ["bash", "-uc"]
set windows-shell := ["powershell.exe", "-NoLogo", "-Command"]
# Show available commands
default:
@just --list --unsorted
# =============================================================================
# Setup Commands
# =============================================================================
# Create virtual environment and install all dependencies
[group('setup')]
setup:
@echo "Creating virtual environment with uv..."
uv venv
@echo ""
@echo "Installing dependencies..."
uv sync --all-extras
@echo ""
@echo "✓ Setup complete!"
@echo ""
@echo "Activate with:"
@echo " source .venv/bin/activate (Linux/macOS)"
@echo " .venv\\Scripts\\activate (Windows)"
@echo ""
@echo "Run tests with: just test"
# Install main dependencies only
[group('setup')]
install:
@echo "Installing main dependencies..."
uv sync
@echo "Dependencies installed"
# Install with dev dependencies
[group('setup')]
install-dev:
@echo "Installing with dev dependencies..."
uv sync --all-extras
@echo "Dev dependencies installed"
# =============================================================================
# Testing & Quality
# =============================================================================
# Run test suite
[group('test')]
test:
@echo "Running tests..."
@echo ""
uv run pytest test_keylogger.py -v
# Run all linting checks (ruff, pylint, mypy)
[group('test')]
lint:
@echo "Running linting checks..."
@echo ""
@echo "=== Ruff ==="
uv run ruff check keylogger.py
@echo ""
@echo "=== Pylint ==="
uv run pylint keylogger.py
@echo ""
@echo "=== Mypy ==="
uv run mypy keylogger.py
@echo ""
@echo "All linting checks passed!"
# Format code with yapf
[group('test')]
format:
@echo "Formatting code with yapf..."
uv run yapf -i keylogger.py test_keylogger.py
@echo "Code formatted"
# Run ruff check and fix
[group('test')]
fix:
@echo "Running ruff fix..."
uv run ruff check keylogger.py --fix
@echo "Ruff fixes applied"
# =============================================================================
# Utilities
# =============================================================================
# Remove virtual environment and cache files
[group('utility')]
clean:
@echo "Cleaning up..."
rm -rf .venv
rm -rf __pycache__
rm -rf *.pyc
rm -rf .mypy_cache
rm -rf .ruff_cache
rm -rf .pytest_cache
rm -rf *.egg-info
rm -rf build
rm -rf dist
@echo "Cleaned"
# Lock dependencies
[group('utility')]
lock:
uv lock
# Update all dependencies
[group('utility')]
update:
uv lock --upgrade
uv sync --all-extras
# Run the keylogger (use with caution - for testing only)
[group('utility')]
[confirm("This will start the keylogger. Continue?")]
run:
uv run python keylogger.py
# =============================================================================
# CI / Full Pipeline
# =============================================================================
# Setup, test, and lint everything
[group('ci')]
all: setup test lint
@echo ""
@echo "=========================================="
@echo "Everything complete!"
@echo "=========================================="
# CI pipeline (tests and linting only, no setup)
[group('ci')]
ci: lint test
@echo "✓ CI checks passed"