Skip to content

Commit 340483f

Browse files
authored
fix(hack): declare the shared package targets and the root test target phony (#3353)
## What this PR does `hack/package.mk` set `.PHONY` with `=` instead of `:`: ```make .PHONY=help show diff apply delete update image ``` That assigns a variable which happens to be named `.PHONY`; it declares nothing. `make -p` prints it back among the variables (`.PHONY = help show diff apply delete update image`) rather than as a special target, so none of the targets `package.mk` defines was phony in any package that includes it. Nothing in the tree collides with those names today, so this is preventive rather than a fix for present breakage. The failure it forecloses is quiet: with a directory named `image` beside a package Makefile, `make image` prints `make: 'image' is up to date.` and exits 0 without building. A file of that name is enough on its own where the rule has no prerequisites; where it has one, the recipe keeps running until that prerequisite is shadowed too. The list changed as well. `suspend`, `resume`, `check` and `clean` are defined in this file and were missing, and `check` is the one that matters most, since it is the prerequisite that keeps `show`, `diff`, `apply` and `delete` rebuilding. `update` and `image` are gone, because `package.mk` does not define them; the including package Makefile does. Naming an undefined target in `.PHONY` creates it as an empty target, turning `No rule to make target` (exit 2) into `Nothing to be done` (exit 0) wherever the rule is missing. That reaches CI too: `hack/build-matrix.sh` parses the root Makefile `build:` target and runs `make -C <pkg> image` per unit, so a package arriving in that list without an `image:` rule would go from a red job to a green one that builds nothing. `.DEFAULT_GOAL` on the line above keeps its `=`. That one is a real variable, so the assignment form is right there. A comment now says which of the two lines is which, since they read alike and one of them just changed shape. `hack/package-mk-phony.bats` covers the declaration and is picked up automatically by the `hack/*.bats` glob in `bats-unit-tests`. Five of its six tests cover `package.mk`: that the declared names are really phony with a file of each name sitting beside the Makefile; a control that mutates a copy back to the assignment form and requires the probe to report up-to-date, so the first cannot pass vacuously; that the declared list and the defined targets are the same set, checked both directions; and two pinning the `update`/`image` exclusion, one requiring the loud failure to survive and one extending the list in a copy and requiring it to disappear. The loud-failure test pins both the exit status 2 and the diagnostic. A wrapper that kept make's wording while returning something else would pass a check on the message alone. One point decides where the guarantee actually lives. The first test reads its names from the `.PHONY:` line, so it cannot see a name dropped from that line at all. The set-equality test is what guards every name's presence. One known gap is left in place. The first test decides by matching make's `is up to date`, which make prints only for a target that has a recipe, and a recipe-less alias never draws it: with no prerequisite both forms print `Nothing to be done`, and with a prerequisite that is itself out of date, which every target in this file is for being phony, the working form prints that prerequisite's recipe while the broken form prints `Nothing to be done`. The probe separates neither pair, so such a name would pass the first test either way. Measured on both shapes, not assumed. Every target `package.mk` defines has a recipe, so nothing is uncovered today; the control test does not close the gap either, since an alias is a defined target and the control requires `is up to date` from it, which turns it red against the probe rather than against the alias. Worth closing if an alias is ever added. One more for whoever edits the suite next: `hack/cozytest.sh` rewrites every bare `}` at column 0 into `return 0` followed by `}`. That is aimed at `@test` blocks, but it does not distinguish them from a plain shell function, so a helper factored out of these tests would silently become unable to return a non-zero status. Tests 1 and 2 repeat a loop rather than share one for reasons of their own, but this is the trap waiting for anyone who merges them. Two properties of the suite are worth stating, because both are easy to get wrong in the other direction. The set-equality test extracts the defined targets with a pattern that accepts a rule naming several targets at once, so `suspend resume: check` keeps both names in the set; anchoring the colon to a single name drops every name on such a line, and for a target nothing else depends on that goes unnoticed. And the control test probes the targets `package.mk` defines rather than the names on its `.PHONY:` line, because `is up to date` is only a meaningful answer for a name that has a rule: a declared-but-undefined name prints `Nothing to be done` in both the working and the broken form, so probing it in the control fails against the probe, while the set-equality test holds the message that names the defect. Last one, about how the tests find the repo. All six read it as `repo=$(pwd)`, which assumes the runner starts at the repo root. That holds for `make bats-unit-tests` and for the invocation the header documents, so nothing is broken, and the assumption is the ordinary shape in `hack/` rather than an outlier: about half the bats files there resolve repo-relative paths against the cwd the same way, several stating it in their own headers, and this is not even the only one spelling it with `$(pwd)`. What is worth naming is the failure mode: started elsewhere, these tests go red with `no '.PHONY:' declaration found in hack/package.mk`, which reads like a real finding rather than a wrong directory. The root `Makefile` had the same defect, and there it had already fired. `test` was not on its `.PHONY:` line and a `test/` directory sits beside it, so `make test` printed `'test' is up to date` and exited 0 without running anything, while `docs/agents/overview.md` advertises that command as the way to run the full suite. CI never used it: the workflow calls `test-controllers` and drives e2e out of `packages/core/testing`, so the cost fell on anyone following the docs by hand. One name on the declaration closes it, and the suite gained a sixth test that goes red without it. Every other undeclared target in that file is unshadowed today, so none of them is reachable the way `test` was, and they are left alone here. #3709 covers the same class in the four `packages/core/` Makefiles, which include only `hack/common-envs.mk` and so are out of reach of this change entirely. ### Downstream repositories `scripts/package.mk` in cozystack/external-apps-example was a byte-for-byte copy of `hack/package.mk` (identical sha256 before this change), carrying the same inert `.PHONY=` line. This PR splits the two files, and the copy was fixed separately. It landed the same nine names, and `update` and `image` are absent there for the reason they are absent here: `scripts/package.mk` does not define them either, and neither does any Makefile that includes it. What separates the two files now is the two-line comment added here, and nothing else. - [ ] No downstream repository is affected by this change - [ ] [cozystack/website](https://github.com/cozystack/website) - follow-up: - [ ] [cozystack/terraform-provider-cozystack](https://github.com/cozystack/terraform-provider-cozystack) - follow-up: - [ ] [cozystack/ansible-cozystack](https://github.com/cozystack/ansible-cozystack) - follow-up: - [ ] [cozystack/ccp](https://github.com/cozystack/ccp) - follow-up: - [ ] [cozystack/talm](https://github.com/cozystack/talm) - follow-up: - [ ] [cozystack/cozyhr](https://github.com/cozystack/cozyhr) - follow-up: - [ ] [cozystack/cozy-proxy](https://github.com/cozystack/cozy-proxy) - follow-up: - [ ] [cozystack/cozystack-telemetry-server](https://github.com/cozystack/cozystack-telemetry-server) - follow-up: - [x] [cozystack/external-apps-example](https://github.com/cozystack/external-apps-example) - follow-up: cozystack/external-apps-example#4 - [ ] [cozystack/examples](https://github.com/cozystack/examples) - follow-up: ### Release note ```release-note NONE ``` <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit * **Bug Fixes** * Fixed task declaration handling so supported commands are correctly recognized and executed. * Updated available commands by replacing `update` and `image` with `suspend`, `resume`, `check`, and `clean`. * **Tests** * Added coverage to verify command declarations, prevent regressions, and ensure invalid or missing commands report errors correctly. <!-- end of auto-generated comment: release notes by coderabbit.ai -->
2 parents 09dc7f4 + d978a37 commit 340483f

4 files changed

Lines changed: 335 additions & 3 deletions

File tree

‎Makefile‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
.PHONY: manifests assets unit-tests helm-unit-tests bats-unit-tests rd-presets-check migrations-target-check test-controllers preflight
1+
.PHONY: manifests assets unit-tests helm-unit-tests bats-unit-tests rd-presets-check migrations-target-check test test-controllers preflight
22

33
include hack/common-envs.mk
44

‎docs/agents/contributing.md‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -215,7 +215,7 @@ Its CI validates internal consistency only, never against this repo.
215215

216216
It has no CI at all, it vendors copies of this repo's tooling, and it is the reference every third-party catalogue is built from, so it breaks quietly and takes them with it.
217217

218-
- Change `hack/package.mk` → its `scripts/package.mk` is a byte-for-byte copy.
218+
- Change `hack/package.mk` → its `scripts/package.mk` was a byte-for-byte copy of ours and no longer is. Diff the two and port your change; do not paste our file over theirs.
219219
- Change `hack/update-crd.sh` → its `scripts/update-appdef.sh` is a miniature of it.
220220
- Change the `ApplicationDefinition` CRD, above all the `release.chartRef.kind` enum in `packages/system/application-definition-crd/definition/` → it still uses `chartRef.kind: HelmChart` while this repo has moved on to `ExternalArtifact`. Dropping `HelmChart` from the enum kills it outright.
221221
- Change the `release.labels` convention, for example the `flux-shard-operator` sharding key.

‎hack/package-mk-phony.bats‎

Lines changed: 330 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,330 @@
1+
#!/usr/bin/env bats
2+
# -----------------------------------------------------------------------------
3+
# Unit tests for the .PHONY declarations this tree depends on: the one in
4+
# hack/package.mk, which most package Makefiles under packages/ include, and the
5+
# root Makefile's, where one target is already shadowed by a real path.
6+
#
7+
# `.PHONY=a b c` assigns a variable; `.PHONY: a b c` declares targets. Only the
8+
# second does anything, and make reports neither. The declaration lists the nine
9+
# targets package.mk defines and stops there.
10+
#
11+
# `update` and `image` are deliberately absent: package.mk does not define them,
12+
# the including package Makefile does, and naming an undefined target in .PHONY
13+
# creates it as an empty target. That turns "No rule to make target" (exit 2)
14+
# into "Nothing to be done" (exit 0) wherever the rule is missing, including the
15+
# CI build matrix, which is parsed from the root Makefile `build:` target and
16+
# runs `make -C <pkg> image` per unit. The last two tests pin the exclusion.
17+
#
18+
# The first test and the control below deliberately read different lists — the
19+
# first the names on the `.PHONY:` line, the control the targets the file
20+
# defines — and merging them back into one is the tidy-up to resist. Which list
21+
# each takes is argued where it is taken.
22+
#
23+
# The first test is narrower than its name suggests, in two ways. It probes the
24+
# names on the `.PHONY:` line, so it cannot see a name dropped from that line;
25+
# the set-equality test is what guards every name's presence. And it decides by
26+
# matching make's "is up to date", which make prints only for a target that has
27+
# a recipe. A recipe-less alias never draws it: with no prerequisite both forms
28+
# print "Nothing to be done", and with a prerequisite that is itself out of
29+
# date, which every target here is for being phony, the working form prints that
30+
# prerequisite's recipe while the broken form prints "Nothing to be done". The
31+
# probe separates neither pair, so it would pass on such a name either way.
32+
# Every target package.mk defines has a recipe, so nothing is uncovered today.
33+
# The control test below does not close the gap either: an alias is a defined
34+
# target, so the control probes it and requires "is up to date" from it, which
35+
# turns the control red against the probe rather than against the alias.
36+
# Adding one means revisiting both.
37+
#
38+
# The decoy files all carry one fixed timestamp, and that is load-bearing rather
39+
# than tidy. Six of the nine targets take `check` as a prerequisite, and `apply`
40+
# and `delete` reach it through `suspend` as well. Touch the decoys in list order
41+
# and `check` lands newer than the targets that depend on it, so make rebuilds
42+
# them for that reason alone and prints a recipe whatever `.PHONY` says. The
43+
# probe then reports success against the broken form. Equal mtimes remove the
44+
# question: nothing is ever newer than its own prerequisite, in any list order,
45+
# so the recipe running means phony and nothing else. Measured on GNU Make 4.3,
46+
# which is what CI runs, list order hid the bug for up to six of the nine, and
47+
# which six moved with where the clock tick fell. On 3.81 the whole loop landed
48+
# inside one timestamp and hid nothing, so a local run could not see it.
49+
#
50+
# Constraints on anyone editing this file: every make invocation is pinned to
51+
# LC_ALL=C, because the assertions match English make wording; cozytest.sh
52+
# recognizes only @test blocks and a bare `}` at column 0, and injects `set -e`,
53+
# so exit statuses are captured explicitly rather than tested inline.
54+
#
55+
# Run with: hack/cozytest.sh hack/package-mk-phony.bats
56+
# -----------------------------------------------------------------------------
57+
58+
@test "every target hack/package.mk declares phony still runs when a file of that name exists" {
59+
repo=$(pwd)
60+
targets=$(sed -n 's/^\.PHONY:[[:space:]]*//p' "$repo/hack/package.mk")
61+
62+
# Without this guard the loop below is a vacuous pass against `.PHONY=`,
63+
# which the sed no longer matches.
64+
if [ -z "$targets" ]; then
65+
echo "no '.PHONY:' declaration found in hack/package.mk" >&2
66+
exit 1
67+
fi
68+
69+
tmp=$(mktemp -d)
70+
printf 'include %s/hack/package.mk\n' "$repo" > "$tmp/Makefile"
71+
72+
# One fixed timestamp for every decoy, so no target is ever newer than a
73+
# target it depends on. See the header: list order silently disarms this
74+
# probe for the targets that hang off `check`.
75+
for t in $targets; do
76+
touch -t 200101010000 "$tmp/$t"
77+
done
78+
79+
for t in $targets; do
80+
# cozytest.sh runs with `set -e`, so capture the exit status explicitly
81+
# rather than letting a failing make abort before the diagnostics below.
82+
rc=0
83+
out=$(LC_ALL=C make --dry-run --directory "$tmp" "$t" 2>&1) || rc=$?
84+
if [ "$rc" -ne 0 ]; then
85+
echo "make $t exited $rc under --dry-run:" >&2
86+
echo "$out" >&2
87+
rm -rf "$tmp"
88+
exit 1
89+
fi
90+
case "$out" in
91+
*"is up to date"*)
92+
echo "make $t no-oped with a file named $t present:" >&2
93+
echo "$out" >&2
94+
echo "hack/package.mk does not actually declare $t phony" >&2
95+
rm -rf "$tmp"
96+
exit 1
97+
;;
98+
esac
99+
done
100+
101+
rm -rf "$tmp"
102+
}
103+
104+
@test "the probe reports up-to-date when .PHONY is written as an assignment" {
105+
# Negative control: proves the probe can see a file-backed target at all.
106+
# The list is the targets package.mk defines, not the names on its `.PHONY:`
107+
# line, because "is up to date" is only a meaningful answer for a name that
108+
# has a rule. A declared name the file does not define prints "Nothing to be
109+
# done" in both forms, so probing it here fails against the probe instead of
110+
# against the defect; the set-equality test is what catches that name, and
111+
# it carries the message that says so. The list is read from the original
112+
# file: the copy is the mutated one.
113+
repo=$(pwd)
114+
targets=$(grep -E '^[A-Za-z0-9][A-Za-z0-9_-]*([[:space:]]+[A-Za-z0-9][A-Za-z0-9_-]*)*:' \
115+
"$repo/hack/package.mk" \
116+
| grep -vE '^[^:]*:+=' | sed 's/:.*//' \
117+
| tr ' ' '\n' | grep -v '^$' | sort -u)
118+
if [ -z "$targets" ]; then
119+
echo "no targets extracted from hack/package.mk — extraction broke" >&2
120+
exit 1
121+
fi
122+
123+
tmp=$(mktemp -d)
124+
125+
sed 's/^\.PHONY:/.PHONY=/' "$repo/hack/package.mk" > "$tmp/package.mk"
126+
if ! grep -q '^\.PHONY=' "$tmp/package.mk"; then
127+
echo "mutation to the assignment form did not apply to the copy" >&2
128+
rm -rf "$tmp"
129+
exit 1
130+
fi
131+
132+
printf 'include %s/package.mk\n' "$tmp" > "$tmp/Makefile"
133+
134+
# Same fixed timestamp as the first test, for the same reason.
135+
for t in $targets; do
136+
touch -t 200101010000 "$tmp/$t"
137+
done
138+
139+
for t in $targets; do
140+
rc=0
141+
out=$(LC_ALL=C make --dry-run --directory "$tmp" "$t" 2>&1) || rc=$?
142+
if [ "$rc" -ne 0 ]; then
143+
echo "make $t exited $rc under --dry-run:" >&2
144+
echo "$out" >&2
145+
rm -rf "$tmp"
146+
exit 1
147+
fi
148+
case "$out" in
149+
*"is up to date"*) ;;
150+
*)
151+
echo "probe failed to detect a file-backed $t:" >&2
152+
echo "$out" >&2
153+
rm -rf "$tmp"
154+
exit 1
155+
;;
156+
esac
157+
done
158+
159+
rm -rf "$tmp"
160+
}
161+
162+
@test "the .PHONY list and the targets package.mk defines are the same set" {
163+
# The first test only probes names already on the list, so this is the sole
164+
# guard on a name being dropped from it. The reverse direction catches a
165+
# declared-but-undefined name, which make turns into an empty target.
166+
# `%-update` is out of reach for both: .PHONY matches literally.
167+
repo=$(pwd)
168+
# Flattened because the `case` tests match on " name " and an embedded
169+
# newline makes a name fail that check and get reported wrongly.
170+
declared=$(sed -n 's/^\.PHONY:[[:space:]]*//p' "$repo/hack/package.mk" \
171+
| tr '\n' ' ')
172+
# A target name outside this pattern — leading underscore, dot, slash — is
173+
# legal in make and skipped here in silence, so keep new names inside it.
174+
# One rule may name several targets, so the pattern accepts a run of them
175+
# and the `tr` splits the run apart again; anchoring the colon to a single
176+
# name instead would drop every name on such a line, silently for a target
177+
# nothing depends on. The second grep drops assignments by the `:=` itself
178+
# rather than by whatever precedes it, `:+` covering `::=` and `:::=`, so
179+
# `export FOO:=bar` goes too — matching the name in front instead would let
180+
# that line through and report `export` and `FOO` as undeclared targets.
181+
defined=$(grep -E '^[A-Za-z0-9][A-Za-z0-9_-]*([[:space:]]+[A-Za-z0-9][A-Za-z0-9_-]*)*:' \
182+
"$repo/hack/package.mk" \
183+
| grep -vE '^[^:]*:+=' | sed 's/:.*//' \
184+
| tr ' ' '\n' | grep -v '^$' | sort -u | tr '\n' ' ')
185+
186+
if [ -z "$declared" ] || [ -z "$defined" ]; then
187+
echo "could not extract targets from hack/package.mk — extraction broke" >&2
188+
exit 1
189+
fi
190+
191+
missing=""
192+
for t in $defined; do
193+
case " $declared " in
194+
*" $t "*) ;;
195+
*) missing="$missing $t" ;;
196+
esac
197+
done
198+
199+
if [ -n "$missing" ]; then
200+
echo "hack/package.mk defines these targets but does not declare them phony:$missing" >&2
201+
echo "a file of that name next to a package Makefile would silence the recipe" >&2
202+
exit 1
203+
fi
204+
205+
undefined=""
206+
for t in $declared; do
207+
case " $defined " in
208+
*" $t "*) ;;
209+
*) undefined="$undefined $t" ;;
210+
esac
211+
done
212+
213+
if [ -n "$undefined" ]; then
214+
echo "hack/package.mk declares these targets phony but defines none of them:$undefined" >&2
215+
echo "naming an undefined target in .PHONY creates it as an empty target, so the" >&2
216+
echo "command reports success instead of failing with 'No rule to make target'" >&2
217+
exit 1
218+
fi
219+
}
220+
221+
@test "update and image stay undeclared so a package without the rule fails loudly" {
222+
# Pins the exclusion: a package with no `update:`/`image:` rule must still
223+
# fail loudly. Declaring them centrally would make every such package report
224+
# success having built nothing, CI included.
225+
repo=$(pwd)
226+
tmp=$(mktemp -d)
227+
228+
printf 'include %s/hack/package.mk\n' "$repo" > "$tmp/Makefile"
229+
230+
for t in update image; do
231+
rc=0
232+
out=$(LC_ALL=C make --directory "$tmp" "$t" 2>&1) || rc=$?
233+
# Exit status and diagnostic are independent observables, so both are
234+
# pinned. 2 is what make returns for a fatal error, and the number is
235+
# what a caller branches on — a wrapper or a future make that kept the
236+
# wording while returning something else would pass the case below.
237+
if [ "$rc" -ne 2 ]; then
238+
echo "expected 'make $t' to exit 2 in a package that defines no $t rule," >&2
239+
echo "but it exited $rc — is $t named in the .PHONY list?" >&2
240+
echo "$out" >&2
241+
rm -rf "$tmp"
242+
exit 1
243+
fi
244+
case "$out" in
245+
*"No rule to make target"*) ;;
246+
*)
247+
echo "expected 'make $t' to report no rule to make target, got:" >&2
248+
echo "$out" >&2
249+
rm -rf "$tmp"
250+
exit 1
251+
;;
252+
esac
253+
done
254+
255+
rm -rf "$tmp"
256+
}
257+
258+
@test "adding update and image to the .PHONY list silences that failure" {
259+
# Negative control. Test 4 passes vacuously if its Makefile never reads
260+
# package.mk at all: a broken `include` path also exits non-zero with "No
261+
# rule to make target", naming the missing file. This mutates a copy and
262+
# greps that the mutation landed, so a wrong path fails here instead.
263+
repo=$(pwd)
264+
tmp=$(mktemp -d)
265+
266+
sed 's/^\(\.PHONY:.*\)$/\1 update image/' "$repo/hack/package.mk" > "$tmp/package.mk"
267+
if ! grep -q '^\.PHONY:.* update image$' "$tmp/package.mk"; then
268+
echo "mutation extending the declaration did not apply to the copy" >&2
269+
rm -rf "$tmp"
270+
exit 1
271+
fi
272+
273+
printf 'include %s/package.mk\n' "$tmp" > "$tmp/Makefile"
274+
275+
for t in update image; do
276+
rc=0
277+
out=$(LC_ALL=C make --directory "$tmp" "$t" 2>&1) || rc=$?
278+
if [ "$rc" -ne 0 ]; then
279+
echo "mutation did not take effect: 'make $t' still failed with exit $rc" >&2
280+
echo "$out" >&2
281+
rm -rf "$tmp"
282+
exit 1
283+
fi
284+
case "$out" in
285+
*"Nothing to be done"*) ;;
286+
*)
287+
echo "expected the mutated copy to report nothing to be done for $t, got:" >&2
288+
echo "$out" >&2
289+
rm -rf "$tmp"
290+
exit 1
291+
;;
292+
esac
293+
done
294+
295+
rm -rf "$tmp"
296+
}
297+
298+
@test "the root Makefile declares test phony so the test directory cannot shadow it" {
299+
# The one target in this tree that a real path already shadows. `test:` in
300+
# the root Makefile produces no file, so make treats the existing test/
301+
# directory as its product: undeclared, `make test` prints "is up to date"
302+
# and the recipe never runs, while docs/agents/overview.md advertises the
303+
# command as the way to run the full suite. Every other undeclared target
304+
# in that file is unshadowed today, so this is the only live one.
305+
#
306+
# Probed with --dry-run because the recipe wants a live cluster. The path is
307+
# what makes the probe mean anything, so its absence fails loudly rather
308+
# than passing quietly.
309+
repo=$(pwd)
310+
if [ ! -e "$repo/test" ]; then
311+
echo "no test/ path at the repo root: this probe no longer measures anything" >&2
312+
exit 1
313+
fi
314+
315+
rc=0
316+
out=$(LC_ALL=C make --dry-run --directory "$repo" test 2>&1) || rc=$?
317+
if [ "$rc" -ne 0 ]; then
318+
echo "make test exited $rc under --dry-run:" >&2
319+
echo "$out" >&2
320+
exit 1
321+
fi
322+
case "$out" in
323+
*"is up to date"*)
324+
echo "make test no-oped with the test/ path present:" >&2
325+
echo "$out" >&2
326+
echo "the root Makefile does not declare test phony" >&2
327+
exit 1
328+
;;
329+
esac
330+
}

‎hack/package.mk‎

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
1+
# .DEFAULT_GOAL is a variable, so `=` is correct here. .PHONY is a target and
2+
# takes a colon; written as an assignment it declares nothing and make is silent.
13
.DEFAULT_GOAL=help
2-
.PHONY=help show diff apply delete update image
4+
.PHONY: help show diff apply delete suspend resume check clean
35

46
help: ## Show this help.
57
@awk 'BEGIN {FS = ":.*?## "} /^[a-zA-Z_-]+:.*?## / {sub("\\\\n",sprintf("\n%22c"," "), $$2);printf "\033[36m%-20s\033[0m %s\n", $$1, $$2}' $(MAKEFILE_LIST)

0 commit comments

Comments
 (0)