-
Notifications
You must be signed in to change notification settings - Fork 14
refactor: streamline makefile by consolidating commands and improving readability #1046
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
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| @@ -0,0 +1,51 @@ | ||||||||||||||
| clean: | ||||||||||||||
| @go clean -testcache | ||||||||||||||
| @rm -rf ./bin | ||||||||||||||
| @rm -rf /go/bin/terraform-provider-power-platform | ||||||||||||||
|
|
||||||||||||||
| deps: clean | ||||||||||||||
| @go mod tidy | ||||||||||||||
|
|
||||||||||||||
| build: deps | ||||||||||||||
| @go fmt ./... | ||||||||||||||
| @go build -o ./bin/ | ||||||||||||||
|
Comment on lines
+9
to
+11
|
||||||||||||||
|
|
||||||||||||||
| install: deps | ||||||||||||||
| @go fmt ./... | ||||||||||||||
| @go install | ||||||||||||||
|
Comment on lines
+13
to
+15
|
||||||||||||||
|
|
||||||||||||||
| userdocs: | ||||||||||||||
| @go generate | ||||||||||||||
| @tfplugindocs validate --provider-name powerplatform | ||||||||||||||
|
|
||||||||||||||
| userstory: | ||||||||||||||
| @./scripts/user_story_prompt.sh | ||||||||||||||
|
|
||||||||||||||
| unittest: clean install | ||||||||||||||
| @TF_ACC=0 go test -p 16 -timeout 10m -v -cover ./... -run "^TestUnit$(TEST)" | ||||||||||||||
|
|
||||||||||||||
| acctest: clean install | ||||||||||||||
| ifeq ($(USE_PROXY),1) | ||||||||||||||
| @HTTP_PROXY=http://127.0.0.1:8080 HTTPS_PROXY=http://127.0.0.1:8080 TF_ACC=1 go test -p 10 -timeout 300m -v ./... -run "^TestAcc$(TEST)" | ||||||||||||||
| else | ||||||||||||||
| @TF_ACC=1 go test -p 10 -timeout 300m -v ./... -run "^TestAcc$(TEST)" | ||||||||||||||
| endif | ||||||||||||||
|
|
||||||||||||||
| test: clean install | ||||||||||||||
| @TF_ACC=1 go test -p 10 -timeout 300m -v -cover ./... | ||||||||||||||
|
|
||||||||||||||
| coverage: clean install | ||||||||||||||
| @echo "Changed files:" | ||||||||||||||
| @gh pr diff --name-only || true | ||||||||||||||
|
||||||||||||||
| @gh pr diff --name-only || true | |
| @if command -v gh >/dev/null 2>&1; then \ | |
| gh pr diff --name-only || echo "Note: 'gh pr diff' failed (are you running in a PR context?); skipping changed-files list."; \ | |
| else \ | |
| echo "Note: GitHub CLI 'gh' not found; skipping changed-files list."; \ | |
| fi |
Copilot
AI
Jan 21, 2026
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The precommit target lists 'clean' as a dependency, but 'build' already depends on 'deps' which depends on 'clean', and 'unittest' also depends on 'clean'. This creates redundant dependencies. While Make will only execute clean once, the explicit listing makes the dependency chain unclear. Consider removing 'clean' from the precommit dependencies since it's already transitively included through build and unittest.
| precommit: clean build lint unittest userdocs | |
| precommit: build lint unittest userdocs |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The deps target now has a dependency on clean, which means every time deps is called, the test cache and binaries will be cleaned. Since build and install targets depend on deps, this causes unnecessary cleanup operations during normal builds. This could slow down the development workflow significantly. Consider removing the clean dependency from deps and only add it where explicitly needed (like in unittest, acctest, test, coverage targets).