mirror of
https://github.com/kevinveenbirkenbach/computer-playbook.git
synced 2026-11-06 02:54:26 +00:00
fix(lint): make mbake format the Makefile the same on every machine
The repository installs mbake unpinned and shipped no .bake.toml, so the
Makefile's final newline depended on the mbake version:
- mbake 1.4.6 (e.g. the pkgmgr venv that wins on a host PATH) defaults
to ensure_final_newline = false: `mbake format` strips the newline and
`mbake format --check` accepts the stripped file.
- mbake 1.5.0 (what pip installs today) rejects the same file with
"Missing final newline", which is what CI reported on PR #1255.
So a local `make autoformat` could strip the newline, the local
lint-makefile stayed green, and CI failed; 6f653ce633 and #1262 had to
restore the newline by hand.
The tracked .bake.toml sets only ensure_final_newline = true, so every
other formatter rule keeps its default. autoformat.sh and makefile.sh
pass it with --config, so the result no longer depends on the version
or on the directory mbake runs from. Checked with both versions: main's
Makefile passes `--check --config .bake.toml`, and a copy without the
final newline fails it with "Missing final newline".
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
34099ce550
commit
618a640d4a
3 files changed
+5
-3
No files matched your search
@@ -0,0 +1,2 @@
|
||||
[formatter]
|
||||
ensure_final_newline = true
|
||||
@@ -139,8 +139,8 @@ run_mbake() {
|
||||
return 0
|
||||
fi
|
||||
local rc=0
|
||||
mbake format Makefile >/dev/null 2>&1 || rc=$?
|
||||
[[ $rc -eq 0 ]] && { mbake format Makefile >/dev/null 2>&1 || rc=$?; }
|
||||
mbake format --config .bake.toml Makefile >/dev/null 2>&1 || rc=$?
|
||||
[[ $rc -eq 0 ]] && { mbake format --config .bake.toml Makefile >/dev/null 2>&1 || rc=$?; }
|
||||
if [[ $rc -eq 0 ]]; then
|
||||
write_status mbake OK
|
||||
else
|
||||
|
||||
@@ -17,4 +17,4 @@ if ! command -v mbake >/dev/null 2>&1; then
|
||||
exit 127
|
||||
fi
|
||||
|
||||
mbake format --check Makefile
|
||||
mbake format --check --config .bake.toml Makefile
|
||||
Reference in new issue
Block a user