You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Builtins.tofu fix adds a newline to empty .tf files that tofu fmt accepts #1873
git init &&:> empty.tf && git add -A
hk check --all # exit 0
tofu fmt -check empty.tf # exit 0
hk fix --all # exit 0
xxd empty.tf
What happened
00000000: 0a .
hk fix writes a single newline into the empty file, although hk check and tofu fmt -check both accept it, and tofu fmt empty.tf leaves it empty. The builtin's check_diff runs tofu fmt -, which turns empty input into "\n", and hk applies that diff.
Expected: hk fix leaves files alone that tofu fmt leaves alone.
Activity
fix(builtins): keep empty files empty when fixing with tofu, terrafor…
github-actions commentedon Nov 23, 2026
Fixed in v2.14.0 by #1874.