-
Notifications
You must be signed in to change notification settings - Fork 9k
Open
Labels
Area-CodeHealthIssues related to code cleanliness, linting, rules, warnings, errors, static analysis, etc.Issues related to code cleanliness, linting, rules, warnings, errors, static analysis, etc.Issue-TaskIt's a feature request, but it doesn't really need a major design.It's a feature request, but it doesn't really need a major design.Product-TerminalThe new Windows Terminal.The new Windows Terminal.
Milestone
Description
This makes you wonder if you scared your code, because it's trying to flee from your screen:
bool ControlCore::SendMouseEvent(const til::point viewportPos,
const unsigned int uiButton,
const ControlKeyStates states,
const short wheelDelta,
const TerminalInput::MouseButtonState state)
{
return _terminal->SendMouseEvent(viewportPos, uiButton, states, wheelDelta, state);
}This on the other hand is the one true way, no exceptions (sample size = 1, myself):
bool ControlCore::SendMouseEvent(
const til::point viewportPos,
const unsigned int uiButton,
const ControlKeyStates states,
const short wheelDelta,
const TerminalInput::MouseButtonState state
) {
return _terminal->SendMouseEvent(viewportPos, uiButton, states, wheelDelta, state);
}We can get this behavior by setting AlignAfterOpenBracket: BlockIndent in .clang-format. The problems:
- Code like the former example, will not be formatted like the latter example even if we set that option, because the former isn't actually block indented to begin with! It's just line breaks after the first argument and so clang-format turns it into:
Most of our code looks like that unfortunately. This would be correct from the POV of clang-format:
bool ControlCore::SendMouseEvent(const til::point viewportPos, const unsigned int uiButton, const ControlKeyStates states, const short wheelDelta, const TerminalInput::MouseButtonState state) { return _terminal->SendMouseEvent(viewportPos, uiButton, states, wheelDelta, state); }
This can be mostly fixed with this regex replacement:bool ControlCore::SendMouseEvent( const til::point viewportPos, const unsigned int uiButton, const ControlKeyStates states, const short wheelDelta, const TerminalInput::MouseButtonState state) { return _terminal->SendMouseEvent(viewportPos, uiButton, states, wheelDelta, state); }
((?!\s|::)\w+\()([^{}()]+,$)->$1\n$2 - Oww:
523 files changed, 15819 insertions(+), 13065 deletions(-)
Metadata
Metadata
Assignees
Labels
Area-CodeHealthIssues related to code cleanliness, linting, rules, warnings, errors, static analysis, etc.Issues related to code cleanliness, linting, rules, warnings, errors, static analysis, etc.Issue-TaskIt's a feature request, but it doesn't really need a major design.It's a feature request, but it doesn't really need a major design.Product-TerminalThe new Windows Terminal.The new Windows Terminal.