-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathJustfile
More file actions
67 lines (52 loc) · 1.57 KB
/
Justfile
File metadata and controls
67 lines (52 loc) · 1.57 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
test: mypy _lint && check-format
# Testing project
@just _test
# Run test just on the current python version
test-single:
# Test on current python version
uv run pytest
check: mypy lint
# runs lints, but not type checking or tests
#
# Avoids performance penalty of `mypy`
lint: _lint && check-format
_lint:
-ruff check src
fix: && _format fix-spelling
@# Failure to fix should not prevent formatting
-ruff check --fix src
build: mypy && _test check-format
# Build project
uv build
mypy:
uv run mypy src
# runs tests without anything else
_test:
hatch test --all
# Check for spelling issues
spellcheck:
# Check for obvious spelling issues
typos
# Fix obvious spelling issues
fix-spelling:
# Fix obvious spelling issues
typos --write-changes
# taplo logging is excessively verbose (prints 'file detection' but not files changed)
export RUST_LOG := "taplo=warn"
# Checks for formatting issues
check-format: && spellcheck
@# Invoking ruff directly instead of through uv tool run saves ~12ms per command,
@# reducing format --check src time from ~20ms to ~8ms.
@# it reduces time for `ruff --version` from ~16ms to ~3ms.
@# Running through `uv tool run` also frequently requires refresh of
@# project dependencies, which can add an additional 100+ ms
ruff format --check .
ruff check --select I --output-format concise .
# check toml formatting
uvx taplo format --check
format: _format && spellcheck
_format:
ruff format .
ruff check --select 'I' --fix .
# format toml
uvx taplo format