Skip to content

Add help command to the Makefile #2094

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Mar 4, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 14 additions & 9 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,39 +1,44 @@
.PHONY: example test coverage translatable_strings update_translations
.PHONY: example test coverage translatable_strings update_translations help
.DEFAULT_GOAL := help

example:
example: ## Run the example application
python example/manage.py migrate --noinput
-DJANGO_SUPERUSER_PASSWORD=p python example/manage.py createsuperuser \
--noinput --username="$(USER)" --email="$(USER)@mailinator.com"
python example/manage.py runserver

example_test:
example_test: ## Run the test suite for the example application
python example/manage.py test example

test:
test: ## Run the test suite
DJANGO_SETTINGS_MODULE=tests.settings \
python -m django test $${TEST_ARGS:-tests}

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

coverage:
coverage: ## Run the test suite with coverage enabled
python --version
DJANGO_SETTINGS_MODULE=tests.settings \
python -b -W always -m coverage run -m django test -v2 $${TEST_ARGS:-tests}
coverage report
coverage html
coverage xml

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

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

.PHONY: example/django-debug-toolbar.png
example/django-debug-toolbar.png: example/screenshot.py
example/django-debug-toolbar.png: example/screenshot.py ## Update the screenshot in 'README.rst'
python $< --browser firefox --headless -o $@
optipng $@

help: ## Help message for targets
@grep -E '^[a-zA-Z_-]+:.*?## .*$$' $(MAKEFILE_LIST) \
| awk 'BEGIN {FS = ":.*?## "}; {printf "\033[36m%-30s\033[0m %s\n", $$1, $$2}'
2 changes: 2 additions & 0 deletions docs/changes.rst
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@ Pending
* Make ``require_toolbar`` decorator compatible to async views.
* Added link to contributing documentation in ``CONTRIBUTING.md``.
* Replaced ESLint and prettier with biome in our pre-commit configuration.
* Added a Makefile target (``make help``) to get a quick overview
of each target.

5.0.1 (2025-01-13)
------------------
Expand Down