Page MenuHomeFreeBSD

bsdinstall: cleanup whitespace
Needs ReviewPublic

Authored by brd on May 31 2023, 7:44 PM.
Tags
None
Referenced Files
Unknown Object (File)
Thu, Apr 11, 5:17 PM
Unknown Object (File)
Wed, Apr 10, 3:38 AM
Unknown Object (File)
Feb 9 2024, 11:07 AM
Unknown Object (File)
Dec 23 2023, 12:19 AM
Unknown Object (File)
Nov 18 2023, 2:07 PM
Unknown Object (File)
Nov 18 2023, 2:03 PM
Unknown Object (File)
Nov 18 2023, 12:55 PM
Unknown Object (File)
Oct 15 2023, 3:43 AM
Subscribers

Details

Summary

Cleanup whitespace by (mostly) adding missing curly braces

Test Plan

Build and test install

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Skipped
Unit
Tests Skipped

Event Timeline

brd requested review of this revision.May 31 2023, 7:44 PM
jrtc27 requested changes to this revision.EditedMay 31 2023, 7:46 PM

This is not a whitespace cleanup (with the exception of the two trailing spaces in the shell scripts). Single-statement if and for statements are allowed to omit the braces per style(9); in fact it's extremely common to omit them in FreeBSD code.

usr.sbin/bsdinstall/partedit/partedit_x86.c
106–108

This is a style violation

This revision now requires changes to proceed.May 31 2023, 7:46 PM

Move else onto the same line

This is not a whitespace cleanup (with the exception of the two trailing spaces in the shell scripts). Single-statement if and for statements are allowed to omit the braces per style(9); in fact it's extremely common to omit them in FreeBSD code.

Well it kind of is, in that I didn't have to add the space after the closing paren.. I prefer to add the curly braces and be more explicit

In D40362#918919, @brd wrote:

Move else onto the same line

You should revert adding the curly braces in the first place. They are not required here, it's perfectly correct to omit them. And in fact style(9) says not to mix within a function but you're now mixing them.

In D40362#918922, @brd wrote:

This is not a whitespace cleanup (with the exception of the two trailing spaces in the shell scripts). Single-statement if and for statements are allowed to omit the braces per style(9); in fact it's extremely common to omit them in FreeBSD code.

Well it kind of is, in that I didn't have to add the space after the closing paren.. I prefer to add the curly braces and be more explicit

It's pointless churn that introduces some stale violations unless you go and change other lines too in the same functions. Just delete the trailing spaces.

I'll also note it really sucks to have patches in Phabricator without full context as requested by https://wiki.freebsd.org/Phabricator#Create_a_Revision_via_Web_Interface, especially for something like this where context is vital to understanding if there are style violations introduced

usr.sbin/bsdinstall/partedit/partedit_x86.c
101

An example of one that had no whitespace issues in the same function as one that did and thus leads to a style violation with your patch applied due to mixing style