Commit Graph

7 Commits

Author SHA1 Message Date
Jeff Young ffdc46d313 A couple more CLang-Format fixes.
These are probably default values for the base style, but this makes
it more explicit what our coding style is.
2020-12-15 16:12:16 +00:00
Jeff Young 9f5b12c7f7 Fix multiple errors in clang_format, in both syntax and intent. 2020-12-15 12:55:33 +00:00
Ian McInerney a860ac5066 Align assignments using clang format
See discussion in !27
2019-12-27 16:12:01 +00:00
John Beard 272c045c37 Format: Default to switch cases on separate lines by default
Currently, the format enforces single lines when possible, but does
not enforce readable column-based alignment (and, moreover, *removes*
such manually added alignment:

    switch( m_orientation )
    {
    case PIN_RIGHT: m_orientation = PIN_UP; break;
    case PIN_UP: m_orientation = PIN_LEFT; break;
    }

Change this to multi-line by default:

    switch( m_orientation )
    {
    case PIN_RIGHT:
        m_orientation = PIN_UP;
        break;
    case PIN_UP:
        m_orientation = PIN_LEFT;
        break;
    }

If the developer wishes for column-aligned single-line cases, this
is permitted, but much be done manually:

    switch( m_orientation )
    {
    case PIN_RIGHT: m_orientation = PIN_DOWN;  break;
    case PIN_UP:    m_orientation = PIN_RIGHT; break;
    }

CHANGE: the _clang-format file to reflect this, and add note about
manual override in the dev docs.
2019-05-07 09:49:05 +01:00
John Beard 3536840f52 Clang-format: break after templates
Enforce the following format:

template<>
void function<TYPE>()

Rather than:

template<> void function<TYPE>()

This is the more common format in KiCad (about 8:1) and agrees
with the uncrustify.cfg rules.
2019-03-27 14:13:23 +00:00
John Beard e4a10ac355 Tweak _clang-format to bring closer to 'normal' KiCad style 2017-03-20 09:45:51 -04:00
Chris Pavlina e96673ed8d Add clang-format configuration 2017-03-13 09:56:25 -04:00