Skip to content

Commit 7ff8647

Browse files
committed
ci: run gofix as part of codegen
1 parent 169fd02 commit 7ff8647

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

packages/scripts.nix

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ lib.makeScope pkgs.newScope (scripts: {
1919
protoc-gen-go-ttrpc
2020
nix-update
2121
scripts.go-directive-sync
22+
scripts.gofix
2223
];
2324
text = ''
2425
echo "Syncing go directive versions in go.mod/go.work files" >&2
@@ -67,6 +68,8 @@ lib.makeScope pkgs.newScope (scripts: {
6768
6869
echo "Updating default kata-container configuration toml files" >&2
6970
nix run .#scripts.update-kata-configurations
71+
72+
gofix
7073
'';
7174
};
7275

@@ -105,9 +108,11 @@ lib.makeScope pkgs.newScope (scripts: {
105108
done < <(go list -f '{{.Dir}}' -m)
106109
107110
# TODO(katexochen): modernize does not support tags?
111+
# The run will fail for packages that contain only code with build tags,
112+
# thus we ignore the exit code.
108113
while IFS= read -r dir; do
109114
echo "Running modernize on $dir"
110-
(cd "$dir" && modernize -fix ./...) || exitcode=$?
115+
(cd "$dir" && modernize -fix ./...) || true
111116
done < <(go list -f '{{.Dir}}' -m)
112117
113118
exit $exitcode

0 commit comments

Comments
 (0)