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

Mosa.Utility.Launcher: Code style changes #1222

Merged
merged 2 commits into from May 4, 2024

Conversation

AnErrupTion
Copy link
Collaborator

Hello! This PR makes code style changes throughout the Mosa.Utility.Launcher project in order to improve consistency with other projects. The following changes were done:

  • The space shift when putting braces after a case statement has now been removed as a ReSharper rule
  • Code after a statement (like if) was put on a separate line if not already the case
  • Method bodies were transformed into expression bodies whenever possible
  • Null-coalescing operators were used whenever possible
  • Braces around statements were removed if the containing block had only 1 line of code
  • Commented code was removed
  • Variables whose name didn't give any more useful insight into what it is were inlined (e.g. var arg = "convert -f raw [...]";)
  • Strings that were too long (like in Builder.GetLimineCFG()) were transformed into multi-line strings
  • Using blocks were transformed into using statements whenever possible
  • If statements were transformed into 1 switch statement whenever it made sense (when there are more than 2 if statements)
  • Private fields were moved after public fields
  • Patterns were used in comparisons whenever possible
  • Ternary operators were used whenever it made sense for cleaner code

Signed-off-by: AnErrupTion <anerruption@disroot.org>
@AnErrupTion AnErrupTion self-assigned this Apr 24, 2024
Copy link
Member

@charsleysa charsleysa left a comment

Choose a reason for hiding this comment

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

LGTM

@charsleysa charsleysa merged commit af50750 into mosa:master May 4, 2024
56 of 66 checks passed
@AnErrupTion AnErrupTion deleted the launcher-code-style branch May 4, 2024 10:05
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.

None yet

2 participants