[do not merge] Straw-man clang-format example.#616
[do not merge] Straw-man clang-format example.#616rryan wants to merge 1 commit intomixxxdj:masterfrom
Conversation
There was a problem hiding this comment.
Aha, here's an example where it added a space on a code item. But I guess we acknowledged that possibility.
There was a problem hiding this comment.
Yea, this will happen to all commented code basically -- which isn't great but also isn't the worst thing. Maybe commented code should mostly be deleted...
There was a problem hiding this comment.
Do we mind how much more room this takes up? I can see the value of having it split out though, like here, it's now hard to miss the .toInt().
(What do the rules do if the ConfigKey() bit would have extended past the defined line length?)
There was a problem hiding this comment.
We can tweak the costs of each kind of break to try and avoid this. By default clang-format prefers breaking fewer parentheses so it kept ConfigKey together and dropped toInt to the next line instead of breaking ConfigKey and putting toInt at the end of the 2nd line.
Basically, if it's automatic I don't really mind it.
There was a problem hiding this comment.
Given that choice, I agree with its decision because this is clearer than that would've been. (Though the indentation would have probably lined up better.)
There was a problem hiding this comment.
Eclipse does this:
bool bPreferencesBeatDetectionEnabled =
static_cast<bool>(m_pConfig->getValueString(
ConfigKey(BPM_CONFIG_KEY, BPM_DETECTION_ENABLED)).toInt());
It uses a simple double indent line brake rule.
No description provided.