Skip to content
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

Add help command to the make file, to list to be able to list available #4922

Merged
merged 1 commit into from
Jul 6, 2024

Conversation

C0rWin
Copy link
Contributor

@C0rWin C0rWin commented Jul 6, 2024

Added make help Command

Summary

This change introduces a make help command to list all available commands provided by the project's Makefile.

Details
• New Feature: make help command
• Purpose: Improve accessibility and usability by providing a self-documenting feature.
• Implementation:
• Added a help target to the Makefile.
• The help target prints out all available Makefile targets with descriptions.

Usage
Run the following command to see all available commands:

make help

This will output a list of all Makefile targets along with their descriptions, making it easier for developers to understand the available options without needing to read through the entire Makefile.

Example Output

Available commands:
help            List all commands with documentation
all             Builds all targets and runs all non-integration tests/checks
checks          Runs basic checks along with unit and integration tests
basic-checks    Performs basic checks like license, spelling, trailing spaces and linter
desk-check      Runs linters and verify to test changed packages
help-docs       Generate the command reference docs
check-help-docs Check for outdated command reference documentation
spelling        Check for spelling errors
references      Check for outdated references
license         Check for license headers
trailing-spaces Check for trailing spaces
gotools         Install go tools like golint
check-go-version Check for the correct go version
integration-test Runs the integration tests
integration-test-prereqs Setup prerequisites for integration tests
unit-test       Runs the go-test based unit tests
unit-tests      Alias for unit-test
docker-thirdparty Pull thirdparty docker images
docker-thirdparty-couchdb Pull couchdb docker image
verify          Runs unit tests for only the changed package tree
profile         Runs unit tests for all packages in coverprofile mode (slow)
linter          Runs all code checks
check-deps      Check for vendored dependencies that are no longer used
check-metrics-doc Check for outdated reference documentation
generate-metrics-doc Generate metrics reference documentation
check-swagger   Check for outdated swagger
generate-swagger Generate swagger
protos          Generate all protobuf artifacts based on .proto files
native          Ensures all native binaries are available
tools           Builds all tools
docker          Builds all docker images
release         Builds release packages for the host platform
release-all     Builds release packages for all target platforms
dist-all        Builds release packages for all target platforms
docker-list     Generates a list of docker images that 'make docker' produces
docker-clean    Ensures all docker images are available
docker-tag-latest Re-tags the images made by 'make docker' with the :latest tag
clean           Cleans the build area
clean-all       Cleans the build area and removes persistent state
dist-clean      Clean release packages for all target platforms
release-clean   Clean release packages for all target platforms
scan            Run all security scans
scan-govulncheck Run gosec security scan

@C0rWin C0rWin requested a review from a team as a code owner July 6, 2024 08:53
# List all commands with documentation
help: ## List all commands with documentation
@echo "Available commands:"
@awk 'BEGIN {FS = ":.*?## "}; /^[a-zA-Z_-]+:.*?## / {printf "\033[36m%-15s\033[0m %s\n", $$1, $$2}' $(MAKEFILE_LIST)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

oh i didn't know you can specify more than 1 character as the field separator, nice.

…le commands

Signed-off-by: Artem Barger <artem@bargr.net>
@yacovm yacovm enabled auto-merge (squash) July 6, 2024 10:00
@yacovm yacovm merged commit 1601ad7 into hyperledger:main Jul 6, 2024
14 checks passed
@C0rWin C0rWin deleted the make-help-cmd branch July 6, 2024 18:17
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