-
Notifications
You must be signed in to change notification settings - Fork 10.2k
Description
What would you like to be added?
This is a follow-up on #20850 (comment).
Currently, our Bash scripts follow a custom convention of defining the Makefile targets as "passes" that are in the scripts/{test,build,etc}.sh files. This custom (and undocumented) way of maintaining the scripts is difficult to follow by new contributors. Because of this, we currently don't have a standard and have a lot of duplication in our Makefile, spread across different files, and approaches to run these targets/functionality.
Examples of fragmented architecture
- Custom "PASSES" framework:
Lines 109 to 111 in 855c9ba
.PHONY: verify-bom verify-bom: PASSES="bom" ./scripts/test.sh - Executing a Bash script:
Lines 229 to 231 in 855c9ba
.PHONY: sync-toolchain-directive sync-toolchain-directive: ./scripts/sync_go_toolchain_directive.sh - Embedded scripts in the
Makefiletarget:Lines 171 to 178 in 855c9ba
YAMLFMT_VERSION = $(shell cd tools/mod && go list -m -f '{{.Version}}' github.com/google/yamlfmt) .PHONY: fix-yamllint fix-yamllint: ifeq (, $(shell command -v yamlfmt)) $(shell go install github.com/google/yamlfmt/cmd/yamlfmt@$(YAMLFMT_VERSION)) endif yamlfmt -conf tools/.yamlfmt .
We want to simplify and standardize this, without creating a difficult custom framework to implement and maintain.
Why is this needed?
To improve the maintainability of our Bash scripts.