Skip to content

Conversation

SuuperW
Copy link
Contributor

@SuuperW SuuperW commented Sep 23, 2025

So Yoshi can stop yelling at people for not following a style rule that doesn't exist.

Copy link
Member

@YoshiRulz YoshiRulz left a comment

Choose a reason for hiding this comment

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

The relevant linter rule is IDE0011, and it needs csharp_prefer_braces = when_multiline in EditorConfig. (This should replace a bunch of separate StyleCop rules.)

We have an automated test suite in the solution which runs in CI, though you can and should run it before pushing.
There are also [various Analyzers](https://github.com/TASEmulators/BizHawk/wiki/Roslyn-Analyzers-%28third-party%29) (static code analysis plugins) for detecting common mistakes and checking code style. Most of these are enabled by default for the main solution, but you can add `-p:RunStyleCop=true` when building.
In addition, not every style rule is currently enabled, so please make sure you use tabs for indentation and [Allman braces](https://en.wikipedia.org/wiki/Indentation_style#Allman_style), and match the line endings of the file you're editing (but don't try to fix code you're not working on).
In addition, not every style rule is currently enabled, so please make sure you use tabs for indentation and [Allman braces](https://en.wikipedia.org/wiki/Indentation_style#Allman_style) (where braces are used), and match the line endings of the file you're editing (but don't try to fix code you're not working on).
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
In addition, not every style rule is currently enabled, so please make sure you use tabs for indentation and [Allman braces](https://en.wikipedia.org/wiki/Indentation_style#Allman_style) (where braces are used), and match the line endings of the file you're editing (but don't try to fix code you're not working on).
In addition, not every style rule is currently enabled, so please make sure you use tabs for indentation and [Allman braces](https://en.wikipedia.org/wiki/Indentation_style#Allman_style) (when multiline, else omit braces), and match the line endings of the file you're editing (but don't try to fix code you're not working on).

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I do not want to forbid braces on single-line blocks.

@YoshiRulz YoshiRulz added Waiting on dev consensus Meta Relating to code organisation or to things that aren't code labels Sep 24, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Meta Relating to code organisation or to things that aren't code Waiting on dev consensus
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants