From 7ec53bd52c71319a3c95431a843cc5ebbab81dea Mon Sep 17 00:00:00 2001 From: tiennm99 Date: Sun, 6 Sep 2026 09:52:15 +0700 Subject: [PATCH] fix(proto): pin schema and generated code to LF checkouts A Windows checkout with core.autocrlf enabled handed buf a CRLF schema, so an empty comment line reached the codegen plugin as a carriage return rather than an empty string. The plugin pads non-empty lines with a space, and the committed output kept a trailing space that an LF checkout never emits, breaking the generated-code sync check. --- .gitattributes | 9 +++++++++ web/src/lib/proto/noitu/v1/game_pb.d.ts | 2 +- 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/.gitattributes b/.gitattributes index 2d409d8..22b85af 100644 --- a/.gitattributes +++ b/.gitattributes @@ -7,3 +7,12 @@ proto/testdata/*.bin binary # it out of diffs makes reviews readable and stops it inflating language stats. server/gen/** linguist-generated=true web/src/lib/proto/** linguist-generated=true + +# core.autocrlf on Windows would otherwise check these out with CRLF. buf keeps +# the CR inside comment text, so an empty `//` line reaches the codegen plugin +# as "\r" instead of "", and the plugin pads non-empty lines with a space. The +# committed output then carries a trailing space that a LF checkout never +# produces, and the generated-code sync check fails on Linux. +*.proto text eol=lf +server/gen/** text eol=lf +web/src/lib/proto/** text eol=lf diff --git a/web/src/lib/proto/noitu/v1/game_pb.d.ts b/web/src/lib/proto/noitu/v1/game_pb.d.ts index 2615cbd..c459b7c 100644 --- a/web/src/lib/proto/noitu/v1/game_pb.d.ts +++ b/web/src/lib/proto/noitu/v1/game_pb.d.ts @@ -137,7 +137,7 @@ export declare const ResignSchema: GenMessage; /** * RequestRematch asks to play again in the same room after a game ends. - * + * * There is no matching decline: leaving the room is the decline, and the * server already learns about that from the socket closing. One message and * one timeout cover every way a rematch does not happen.