Bring back switch scopes
Description
Currently, sheldon systematically removes the scopes in switch/case
statements.
This saves two lines per case
, but does not necessary increase readability, especially when cases are long.
A side effect is that case
cannot be folded, which is very annoying when you want to focus on part of your code.
When embedding a switch
in another (which is ugly on itself but unfortunately sometimes necessary), it may become even less readable.
Proposal
Scopes never do harm in case
statements.
Fortunately, this parameter is customizable in uncrustify
by replacing the following line in uncrustify.cfg
:
mod_case_brace = remove
The updated version would be:
mod_case_brace = ignore
Thus not forcing on the developer the scope add / removal.
Outcomes
Improved readability, allow case
statements folding,