Skip to content

Commit b5dc19c

Browse files
authored
Add help command to the Makefile (#2094)
Closes #2092
1 parent b78fd4d commit b5dc19c

File tree

2 files changed

+16
-9
lines changed

2 files changed

+16
-9
lines changed

Makefile

+14-9
Original file line numberDiff line numberDiff line change
@@ -1,39 +1,44 @@
1-
.PHONY: example test coverage translatable_strings update_translations
1+
.PHONY: example test coverage translatable_strings update_translations help
2+
.DEFAULT_GOAL := help
23

3-
example:
4+
example: ## Run the example application
45
python example/manage.py migrate --noinput
56
-DJANGO_SUPERUSER_PASSWORD=p python example/manage.py createsuperuser \
67
--noinput --username="$(USER)" --email="$(USER)@mailinator.com"
78
python example/manage.py runserver
89

9-
example_test:
10+
example_test: ## Run the test suite for the example application
1011
python example/manage.py test example
1112

12-
test:
13+
test: ## Run the test suite
1314
DJANGO_SETTINGS_MODULE=tests.settings \
1415
python -m django test $${TEST_ARGS:-tests}
1516

16-
test_selenium:
17+
test_selenium: ## Run frontend tests written with Selenium
1718
DJANGO_SELENIUM_TESTS=true DJANGO_SETTINGS_MODULE=tests.settings \
1819
python -m django test $${TEST_ARGS:-tests}
1920

20-
coverage:
21+
coverage: ## Run the test suite with coverage enabled
2122
python --version
2223
DJANGO_SETTINGS_MODULE=tests.settings \
2324
python -b -W always -m coverage run -m django test -v2 $${TEST_ARGS:-tests}
2425
coverage report
2526
coverage html
2627
coverage xml
2728

28-
translatable_strings:
29+
translatable_strings: ## Update the English '.po' file
2930
cd debug_toolbar && python -m django makemessages -l en --no-obsolete
3031
@echo "Please commit changes and run 'tx push -s' (or wait for Transifex to pick them)"
3132

32-
update_translations:
33+
update_translations: ## Download updated '.po' files from Transifex
3334
tx pull -a --minimum-perc=10
3435
cd debug_toolbar && python -m django compilemessages
3536

3637
.PHONY: example/django-debug-toolbar.png
37-
example/django-debug-toolbar.png: example/screenshot.py
38+
example/django-debug-toolbar.png: example/screenshot.py ## Update the screenshot in 'README.rst'
3839
python $< --browser firefox --headless -o $@
3940
optipng $@
41+
42+
help: ## Help message for targets
43+
@grep -E '^[a-zA-Z_-]+:.*?## .*$$' $(MAKEFILE_LIST) \
44+
| awk 'BEGIN {FS = ":.*?## "}; {printf "\033[36m%-30s\033[0m %s\n", $$1, $$2}'

docs/changes.rst

+2
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,8 @@ Pending
1212
* Make ``require_toolbar`` decorator compatible to async views.
1313
* Added link to contributing documentation in ``CONTRIBUTING.md``.
1414
* Replaced ESLint and prettier with biome in our pre-commit configuration.
15+
* Added a Makefile target (``make help``) to get a quick overview
16+
of each target.
1517

1618
5.0.1 (2025-01-13)
1719
------------------

0 commit comments

Comments
 (0)