Skip to content

Commit 4bad187

Browse files
committed
build(justfile): Add recipe groups for organized listing
why: Improve discoverability with just 1.45.0 grouped recipes what: - Add [group] attributes to root justfile (test, lint, docs, format, typing, dev) - Add [group] attributes to docs/justfile (build, validate, dev, misc)
1 parent 8cb2bc0 commit 4bad187

2 files changed

Lines changed: 45 additions & 36 deletions

File tree

docs/justfile

Lines changed: 31 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -27,143 +27,154 @@ allsphinxopts := "-d " + builddir + "/doctrees " + sphinxopts + " ."
2727
default:
2828
@just --list
2929

30-
# ============================================================================
31-
# Build targets
32-
# ============================================================================
33-
3430
# Build HTML documentation
31+
[group: 'build']
3532
html:
3633
{{ sphinxbuild }} -b html {{ allsphinxopts }} {{ builddir }}/html
3734
@echo ""
3835
@echo "Build finished. The HTML pages are in {{ builddir }}/html."
3936

40-
# Clean build directory
41-
clean:
42-
rm -rf {{ builddir }}/*
43-
4437
# Build directory HTML files
38+
[group: 'build']
4539
dirhtml:
4640
{{ sphinxbuild }} -b dirhtml {{ allsphinxopts }} {{ builddir }}/dirhtml
4741
@echo ""
4842
@echo "Build finished. The HTML pages are in {{ builddir }}/dirhtml."
4943

5044
# Build single HTML file
45+
[group: 'build']
5146
singlehtml:
5247
{{ sphinxbuild }} -b singlehtml {{ allsphinxopts }} {{ builddir }}/singlehtml
5348
@echo ""
5449
@echo "Build finished. The HTML page is in {{ builddir }}/singlehtml."
5550

5651
# Build EPUB
52+
[group: 'build']
5753
epub:
5854
{{ sphinxbuild }} -b epub {{ allsphinxopts }} {{ builddir }}/epub
5955
@echo ""
6056
@echo "Build finished. The epub file is in {{ builddir }}/epub."
6157

6258
# Build LaTeX files
59+
[group: 'build']
6360
latex:
6461
{{ sphinxbuild }} -b latex {{ allsphinxopts }} {{ builddir }}/latex
6562
@echo ""
6663
@echo "Build finished; the LaTeX files are in {{ builddir }}/latex."
6764

6865
# Build PDF via LaTeX
66+
[group: 'build']
6967
latexpdf:
7068
{{ sphinxbuild }} -b latex {{ allsphinxopts }} {{ builddir }}/latex
7169
@echo "Running LaTeX files through pdflatex..."
7270
make -C {{ builddir }}/latex all-pdf
7371
@echo "pdflatex finished; the PDF files are in {{ builddir }}/latex."
7472

7573
# Build plain text files
74+
[group: 'build']
7675
text:
7776
{{ sphinxbuild }} -b text {{ allsphinxopts }} {{ builddir }}/text
7877
@echo ""
7978
@echo "Build finished. The text files are in {{ builddir }}/text."
8079

8180
# Build man pages
81+
[group: 'build']
8282
man:
8383
{{ sphinxbuild }} -b man {{ allsphinxopts }} {{ builddir }}/man
8484
@echo ""
8585
@echo "Build finished. The manual pages are in {{ builddir }}/man."
8686

8787
# Build JSON output
88+
[group: 'build']
8889
json:
8990
{{ sphinxbuild }} -b json {{ allsphinxopts }} {{ builddir }}/json
9091
@echo ""
9192
@echo "Build finished; now you can process the JSON files."
9293

94+
# Clean build directory
95+
[group: 'misc']
96+
[confirm]
97+
clean:
98+
rm -rf {{ builddir }}/*
99+
93100
# Build HTML help files
101+
[group: 'misc']
94102
htmlhelp:
95103
{{ sphinxbuild }} -b htmlhelp {{ allsphinxopts }} {{ builddir }}/htmlhelp
96104
@echo ""
97105
@echo "Build finished; now you can run HTML Help Workshop with the .hhp project file in {{ builddir }}/htmlhelp."
98106

99107
# Build Qt help files
108+
[group: 'misc']
100109
qthelp:
101110
{{ sphinxbuild }} -b qthelp {{ allsphinxopts }} {{ builddir }}/qthelp
102111
@echo ""
103112
@echo "Build finished; now you can run 'qcollectiongenerator' with the .qhcp project file in {{ builddir }}/qthelp."
104113

105114
# Build Devhelp files
115+
[group: 'misc']
106116
devhelp:
107117
{{ sphinxbuild }} -b devhelp {{ allsphinxopts }} {{ builddir }}/devhelp
108118
@echo ""
109119
@echo "Build finished."
110120

111121
# Build Texinfo files
122+
[group: 'misc']
112123
texinfo:
113124
{{ sphinxbuild }} -b texinfo {{ allsphinxopts }} {{ builddir }}/texinfo
114125
@echo ""
115126
@echo "Build finished. The Texinfo files are in {{ builddir }}/texinfo."
116127

117128
# Build Info files from Texinfo
129+
[group: 'misc']
118130
info:
119131
{{ sphinxbuild }} -b texinfo {{ allsphinxopts }} {{ builddir }}/texinfo
120132
@echo "Running Texinfo files through makeinfo..."
121133
make -C {{ builddir }}/texinfo info
122134
@echo "makeinfo finished; the Info files are in {{ builddir }}/texinfo."
123135

124136
# Build gettext catalogs
137+
[group: 'misc']
125138
gettext:
126139
{{ sphinxbuild }} -b gettext {{ sphinxopts }} . {{ builddir }}/locale
127140
@echo ""
128141
@echo "Build finished. The message catalogs are in {{ builddir }}/locale."
129142

130-
# ============================================================================
131-
# Validation
132-
# ============================================================================
133-
134143
# Check all external links
144+
[group: 'validate']
135145
linkcheck:
136146
{{ sphinxbuild }} -b linkcheck {{ allsphinxopts }} {{ builddir }}/linkcheck
137147
@echo ""
138148
@echo "Link check complete; look for any errors in the above output or in {{ builddir }}/linkcheck/output.txt."
139149

140150
# Run doctests embedded in documentation
151+
[group: 'validate']
141152
doctest:
142153
{{ sphinxbuild }} -b doctest {{ allsphinxopts }} {{ builddir }}/doctest
143154
@echo "Testing of doctests in the sources finished, look at the results in {{ builddir }}/doctest/output.txt."
144155

145156
# Check build from scratch
157+
[group: 'validate']
146158
checkbuild:
147159
rm -rf {{ builddir }}
148160
{{ sphinxbuild }} -n -q ./ {{ builddir }}
149161

150162
# Build redirects configuration
163+
[group: 'misc']
151164
redirects:
152165
{{ sphinxbuild }} -b rediraffewritediff {{ allsphinxopts }} {{ builddir }}/redirect
153166
@echo ""
154167
@echo "Build finished. The redirects are in rediraffe_redirects."
155168

156169
# Show changes overview
170+
[group: 'misc']
157171
changes:
158172
{{ sphinxbuild }} -b changes {{ allsphinxopts }} {{ builddir }}/changes
159173
@echo ""
160174
@echo "The overview file is in {{ builddir }}/changes."
161175

162-
# ============================================================================
163-
# Development
164-
# ============================================================================
165-
166176
# Watch files and rebuild on change
177+
[group: 'dev']
167178
watch:
168179
#!/usr/bin/env bash
169180
set -euo pipefail
@@ -174,6 +185,7 @@ watch:
174185
fi
175186
176187
# Serve documentation via Python http.server
188+
[group: 'dev']
177189
serve:
178190
@echo '================================================='
179191
@echo ''
@@ -183,16 +195,19 @@ serve:
183195
python -m http.server {{ http_port }} --directory {{ builddir }}/html
184196

185197
# Watch and serve simultaneously
198+
[group: 'dev']
186199
dev:
187200
#!/usr/bin/env bash
188201
set -euo pipefail
189202
just watch &
190203
just serve
191204
192205
# Start sphinx-autobuild server
206+
[group: 'dev']
193207
start:
194208
{{ sphinx_autobuild }} "{{ sourcedir }}" "{{ builddir }}" {{ sphinxopts }} --port {{ http_port }}
195209

196210
# Design mode: watch static files and disable incremental builds
211+
[group: 'dev']
197212
design:
198213
{{ sphinx_autobuild }} "{{ sourcedir }}" "{{ builddir }}" {{ sphinxopts }} --port {{ http_port }} --watch "." -a

justfile

Lines changed: 14 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -11,20 +11,19 @@ doc_files := "find . -type f -not -path '*/\\.*' | grep -i '.*[.]rst$\\|.*[.]md$
1111
default:
1212
@just --list
1313

14-
# ============================================================================
15-
# Testing
16-
# ============================================================================
17-
1814
# Run tests with pytest
15+
[group: 'test']
1916
test *args:
2017
uv run py.test {{ args }}
2118

2219
# Run tests then start continuous testing with pytest-watcher
20+
[group: 'test']
2321
start:
2422
just test
2523
uv run ptw .
2624

2725
# Watch files and run tests on change (requires entr)
26+
[group: 'test']
2827
watch-test:
2928
#!/usr/bin/env bash
3029
set -euo pipefail
@@ -35,35 +34,33 @@ watch-test:
3534
just _entr-warn
3635
fi
3736
38-
# ============================================================================
39-
# Documentation
40-
# ============================================================================
41-
4237
# Build documentation
38+
[group: 'docs']
4339
build-docs:
4440
just -f docs/justfile html
4541

4642
# Start documentation server with auto-reload
43+
[group: 'docs']
4744
start-docs:
4845
just -f docs/justfile start
4946

5047
# Start documentation design mode (watches static files)
48+
[group: 'docs']
5149
design-docs:
5250
just -f docs/justfile design
5351

54-
# ============================================================================
55-
# Linting & Formatting
56-
# ============================================================================
57-
5852
# Format code with ruff
53+
[group: 'lint']
5954
ruff-format:
6055
uv run ruff format .
6156

6257
# Run ruff linter
58+
[group: 'lint']
6359
ruff:
6460
uv run ruff check .
6561

6662
# Watch files and run ruff on change
63+
[group: 'lint']
6764
watch-ruff:
6865
#!/usr/bin/env bash
6966
set -euo pipefail
@@ -75,10 +72,12 @@ watch-ruff:
7572
fi
7673
7774
# Run mypy type checker
75+
[group: 'lint']
7876
mypy:
7977
uv run mypy $(${{ py_files }})
8078

8179
# Watch files and run mypy on change
80+
[group: 'lint']
8281
watch-mypy:
8382
#!/usr/bin/env bash
8483
set -euo pipefail
@@ -90,25 +89,20 @@ watch-mypy:
9089
fi
9190
9291
# Format markdown files with prettier
92+
[group: 'format']
9393
format-markdown:
9494
prettier --parser=markdown -w *.md docs/*.md docs/**/*.md CHANGES
9595

96-
# ============================================================================
97-
# Typing
98-
# ============================================================================
99-
10096
# Run monkeytype to collect runtime types
97+
[group: 'typing']
10198
monkeytype-create:
10299
uv run monkeytype run $(uv run which py.test)
103100

104101
# Apply collected monkeytype annotations
102+
[group: 'typing']
105103
monkeytype-apply:
106104
uv run monkeytype list-modules | xargs -n1 -I{} sh -c 'uv run monkeytype apply {}'
107105

108-
# ============================================================================
109-
# Private helpers
110-
# ============================================================================
111-
112106
[private]
113107
_entr-warn:
114108
@echo "----------------------------------------------------------"

0 commit comments

Comments
 (0)