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

Put braces on new line in CSharp generator #4348

Merged
merged 2 commits into from
Mar 18, 2024

Conversation

marcinjahn
Copy link
Contributor

@marcinjahn marcinjahn commented Mar 15, 2024

Fixes the C# code generation to follow the usual style of putting braces on new lines.
Fixes #4347

@marcinjahn marcinjahn requested a review from a team as a code owner March 15, 2024 17:56
Copy link
Member

@baywet baywet left a comment

Choose a reason for hiding this comment

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

Thanks for the contribution. Have you thought of adding an optional parameter named something like "curly at next line" default false to the start block method instead?

@marcinjahn
Copy link
Contributor Author

marcinjahn commented Mar 18, 2024

Thanks for the contribution. Have you thought of adding an optional parameter named something like "curly at next line" default false to the start block method instead?

Boolean parameters are always a bit questionable, maybe it could be a separate method. However, in general, I'd say the current approach is alright. In some cases we'd want to move braces to new lines, in some other cases we probably wouldn't want that (e.g. int Something { get; set; }).

Obviously, I'll abide by your decision. If you think I should change something, I can do that.

@marcinjahn marcinjahn requested a review from baywet March 18, 2024 15:27
@baywet baywet enabled auto-merge March 18, 2024 16:15
@baywet baywet merged commit e7e5c9b into microsoft:main Mar 18, 2024
192 checks passed
@marcinjahn marcinjahn deleted the fix-csharp-braces-new-line branch March 18, 2024 16:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

CSharp code should have braces on new line
2 participants