From d33b2ca682b6e15491ee89f07a22b728ff7f3bca Mon Sep 17 00:00:00 2001 From: Timo Stamm Date: Fri, 17 Nov 2023 17:06:06 +0100 Subject: [PATCH] Prevent code gen and formatter fighting over whitespace (#620) --- Makefile | 2 -- packages/protobuf/src/private/feature-set-defaults.ts | 2 +- .../upstream-protobuf/bin/upstream-inject-feature-defaults.mjs | 2 +- 3 files changed, 2 insertions(+), 4 deletions(-) diff --git a/Makefile b/Makefile index 047efb296..308cc21e6 100644 --- a/Makefile +++ b/Makefile @@ -159,8 +159,6 @@ perf: $(BUILD)/protobuf-test bootstrap: $(BUILD)/upstream-protobuf $(BUILD)/protoc-gen-es node_modules ## Bootstrap well-known types and edition features-set defaults in @bufbuild/protobuf from upstream protobuf npm run -w packages/protobuf bootstrap:wkt npm run -w packages/protobuf bootstrap:featureset-defaults - @# If the generated code differs, use it, and run tests again - #npm run -w packages/protobuf bootstrap-diff || $(MAKE) build test format lint .PHONY: setversion setversion: ## Set a new version in for the project, i.e. make setversion SET_VERSION=1.2.3 diff --git a/packages/protobuf/src/private/feature-set-defaults.ts b/packages/protobuf/src/private/feature-set-defaults.ts index 32561c2ae..938455838 100644 --- a/packages/protobuf/src/private/feature-set-defaults.ts +++ b/packages/protobuf/src/private/feature-set-defaults.ts @@ -17,6 +17,6 @@ import { protoBase64 } from "../proto-base64.js"; export const featureSetDefaults = FeatureSetDefaults.fromBinary( protoBase64.dec( - /*upstream-inject-feature-defaults-start*/"ChESDAgBEAIYAiABKAEwAhjmBwoREgwIAhABGAEgAigBMAEY5wcKERIMCAEQARgBIAIoATABGOgHIOYHKOgH"/*upstream-inject-feature-defaults-end*/, + /*upstream-inject-feature-defaults-start*/ "ChESDAgBEAIYAiABKAEwAhjmBwoREgwIAhABGAEgAigBMAEY5wcKERIMCAEQARgBIAIoATABGOgHIOYHKOgH" /*upstream-inject-feature-defaults-end*/, ), ); diff --git a/packages/upstream-protobuf/bin/upstream-inject-feature-defaults.mjs b/packages/upstream-protobuf/bin/upstream-inject-feature-defaults.mjs index ace2c4bfd..a82e1de38 100755 --- a/packages/upstream-protobuf/bin/upstream-inject-feature-defaults.mjs +++ b/packages/upstream-protobuf/bin/upstream-inject-feature-defaults.mjs @@ -45,7 +45,7 @@ async function main(args) { ); for (const path of positionals) { const content = readFileSync(path, "utf-8"); - const r = inject(content, `"${defaults.toString("base64url")}"`); + const r = inject(content, ` "${defaults.toString("base64url")}" `); if (!r.ok) { stderr.write(`Error injecting into ${path}: ${r.message}\n`); exit(1);