Skip to content

chore(makefile): set help target as default goal #393

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
Jul 8, 2025

Conversation

echoix
Copy link
Contributor

@echoix echoix commented Jul 7, 2025

Add explicit comments explaining the purpose of the help target and .DEFAULT_GOAL. This improves readability and makes the Makefile's behavior more transparent.

See https://www.gnu.org/software/make/manual/html_node/Goals.html and https://stackoverflow.com/a/43719512/19489416

The most impactful effect is that now, simply calling "make" will show the help, instead of a weird error (weird for newcomers, like me this weekend). If you like this pattern, feel free to apply it to the other repos that use the same structure.
Before:
image
After:
image

Console output as text for easier searching:

vscode ➜ /workspaces/griffe (makefile-help-default) $ make
Available commands
  help                  Print this help. Add task name to print help.
  setup                 Setup all virtual environments (install dependencies).
  run                   Run a command in the default virtual environment.
  multirun              Run a command for all configured Python versions.
  allrun                Run a command in all virtual environments.
  3.x                   Run a command in the virtual environment for Python 3.x.
  clean                 Delete build artifacts and cache files.
  vscode                Configure VSCode to work on this project.

Available tasks
  build                 Build source and wheel distributions.
  changelog             Update the changelog in-place with latest commits.
  check                 Check it all!
  check-api             Check for API breaking changes.
  check-docs            Check if the documentation builds correctly.
  check-quality         Check the code quality.
  check-types           Check that the code is correctly typed.
  coverage              Report coverage as text and HTML.
  docs                  Serve the documentation (localhost:8000).
  docs-deploy           Deploy the documentation to GitHub pages.
  format                Run formatting tools on the code.
  fuzz                  Fuzz Griffe against generated Python code.
  publish               Publish source and wheel distributions to PyPI.
  release               Release a new version of the project.
  test                  Run the test suite.
vscode ➜ /workspaces/griffe (makefile-help-default) $ 
vscode ➜ /workspaces/griffe (main) $ make
Traceback (most recent call last):
  File "/workspaces/griffe/scripts/make", line 318, in <module>
    sys.exit(main(sys.argv[1:]))
             ~~~~^^^^^^^^^^^^^^
  File "/workspaces/griffe/scripts/make", line 288, in main
    allrun(*args)
    ~~~~~~^^^^^^^
TypeError: allrun() missing 1 required positional argument: 'cmd'
make: *** [Makefile:28: allrun] Error 1
vscode ➜ /workspaces/griffe (main) $ 

Add explicit comments explaining the purpose of the help target and .DEFAULT_GOAL.
This improves readability and makes the Makefile's behavior more transparent.
@echoix
Copy link
Contributor Author

echoix commented Jul 7, 2025

For the failures, see #392 (comment)

pawamoy added a commit to pawamoy/copier-uv that referenced this pull request Jul 8, 2025
@pawamoy
Copy link
Member

pawamoy commented Jul 8, 2025

Thanks a lot! I've updated the template from which this project is generated. I'll merge anyway to add your contribution to the history here 🙂

@pawamoy pawamoy merged commit 1301839 into mkdocstrings:main Jul 8, 2025
21 of 26 checks passed
@echoix echoix deleted the makefile-help-default branch July 8, 2025 17:02
@echoix
Copy link
Contributor Author

echoix commented Jul 8, 2025

You can sync back to your template, overwriting these now that you understood what was made, and that at least a commit exists in the history

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants