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

Adds make help target #93

Merged
merged 6 commits into from
Jan 14, 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
4 changes: 2 additions & 2 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@

We welcome contributions from the community. Please read the following guidelines carefully to maximize the chances of your PR being merged.

## Coding Style
## Development

To ensure your change passes format checks, run `make precommit` and ensure all checks pass.
See `make help`.

## DCO

Expand Down
30 changes: 24 additions & 6 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,23 @@ TAG ?= latest
ENABLE_MULTI_PLATFORMS ?= false
HELM_CHART_VERSION ?= v0.0.0-latest

# This will print out the help message for contributing to the project.
.PHONY: help
help:
@echo "Usage: make <target>"
@echo ""
@echo "All core targets needed for contributing:"
@echo " precommit Run all necessary steps to prepare for a commit."
@echo " test Run the unit tests for the codebase."
@echo " test-cel Run the integration tests of CEL validation rules in API definitions with envtest."
@echo " This will be needed when changing API definitions."
@echo " test-extproc Run the integration tests for extproc without controller or k8s at all."
@echo " Note that this requires some credentials."
@echo " test-controller Run the integration tests for the controller with envtest."
@echo ""
@echo "For example, 'make precommit test' should be enough for initial iterations, and later 'make test-cel' etc."
@echo ""

# This runs the linter, formatter, and tidy on the codebase.
.PHONY: lint
lint: golangci-lint
Expand Down Expand Up @@ -56,20 +73,21 @@ apigen: controller-gen

# This runs all necessary steps to prepare for a commit.
.PHONY: precommit
precommit: tidy codespell apigen format lint
precommit: tidy codespell apigen format lint editorconfig helm-lint

# This runs precommit and checks for any differences in the codebase, failing if there are any.
.PHONY: check
check: editorconfig-checker
@$(MAKE) precommit
@$(MAKE) helm-package --version ${HELM_CHART_VERSION}
@echo "running editorconfig-checker"
@$(EDITORCONFIG_CHECKER)
check: precommit
@if [ ! -z "`git status -s`" ]; then \
echo "The following differences will fail CI until committed:"; \
git diff --exit-code; \
fi

# This runs the editorconfig-checker on the codebase.
editorconfig: editorconfig-checker
@echo "running editorconfig-checker"
@$(EDITORCONFIG_CHECKER)

# This runs the unit tests for the codebase.
.PHONY: test
test:
Expand Down
Loading