Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Stablise program name in generated code preamble #610

Merged
merged 2 commits into from
Oct 18, 2023

Conversation

trixnz
Copy link
Contributor

@trixnz trixnz commented Oct 17, 2023

This PR fixes inconsistencies when running protoc-gen-connect-go on Windows vs Linux.

Before

Windows:

// Code generated by protoc-gen-connect-go.exe. DO NOT EDIT.

Linux:

// Code generated by protoc-gen-connect-go. DO NOT EDIT.

After

Windows:

// Code generated by protoc-gen-connect-go. DO NOT EDIT.

Linux:

// Code generated by protoc-gen-connect-go. DO NOT EDIT.

Reasoning

The existing behaviour results in a lot noisy changes without any impact when developers across multiple operating systems work on the same project. This PR stablises the preamble comment by excluding the extension from the program name.

@CLAassistant
Copy link

CLAassistant commented Oct 17, 2023

CLA assistant check
All committers have signed the CLA.

Copy link
Member

@jhump jhump left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@trixnz, thanks for the PR! See suggestion to make removal of extension more targeted/explicit for Windows.

cmd/protoc-gen-connect-go/main.go Outdated Show resolved Hide resolved
Only remove the extension when it is `.exe`  (Windows)

Co-authored-by: Joshua Humphries <2035234+jhump@users.noreply.github.com>
@trixnz
Copy link
Contributor Author

trixnz commented Oct 18, 2023

@trixnz, thanks for the PR! See suggestion to make removal of extension more targeted/explicit for Windows.

Great catch, I didn't think of that. Thanks! 🎉

@jhump jhump merged commit b6d44ec into connectrpc:main Oct 18, 2023
8 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants