Skip to content

Commit 0582a1a

Browse files
committed
hack: shfmt bake target
Signed-off-by: CrazyMax <[email protected]>
1 parent d2a4031 commit 0582a1a

File tree

5 files changed

+18
-23
lines changed

5 files changed

+18
-23
lines changed

Makefile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,11 +36,11 @@ validate-vendor:
3636

3737
.PHONY: validate-shfmt
3838
validate-shfmt:
39-
./hack/validate-shfmt
39+
$(BUILDX_CMD) bake validate-shfmt
4040

4141
.PHONY: shfmt
4242
shfmt:
43-
./hack/shfmt
43+
$(BUILDX_CMD) bake shfmt
4444

4545
.PHONY: validate-authors
4646
validate-authors:

docker-bake.hcl

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ target "_common" {
2020
}
2121

2222
group "validate" {
23-
targets = ["lint", "validate-vendor", "validate-doctoc", "validate-generated-files"]
23+
targets = ["lint", "validate-vendor", "validate-doctoc", "validate-generated-files", "validate-shfmt"]
2424
}
2525

2626
target "lint" {
@@ -43,6 +43,13 @@ target "validate-generated-files" {
4343
output = ["type=cacheonly"]
4444
}
4545

46+
target "validate-shfmt" {
47+
inherits = ["_common"]
48+
dockerfile = "./hack/dockerfiles/shfmt.Dockerfile"
49+
target = "validate"
50+
output = ["type=cacheonly"]
51+
}
52+
4653
target "validate-doctoc" {
4754
inherits = ["_common"]
4855
dockerfile = "./hack/dockerfiles/doctoc.Dockerfile"
@@ -71,6 +78,13 @@ target "generated-files" {
7178
output = ["."]
7279
}
7380

81+
target "shfmt" {
82+
inherits = ["_common"]
83+
dockerfile = "./hack/dockerfiles/shfmt.Dockerfile"
84+
target = "update"
85+
output = ["."]
86+
}
87+
7488
target "doctoc" {
7589
inherits = ["_common"]
7690
dockerfile = "./hack/dockerfiles/doctoc.Dockerfile"

hack/dockerfiles/shfmt.Dockerfile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
# syntax=docker/dockerfile-upstream:master
2+
23
FROM mvdan/shfmt:v3.1.2-alpine AS shfmt
34
WORKDIR /src
45
ARG SHFMT_FLAGS="-i 2 -ci"

hack/shfmt

Lines changed: 0 additions & 10 deletions
This file was deleted.

hack/validate-shfmt

Lines changed: 0 additions & 10 deletions
This file was deleted.

0 commit comments

Comments
 (0)