Force indentation of lines after an else in checksrc #2532

Closed
wants to merge 2 commits into
from

Conversation

Projects
None yet
3 participants
@danielgustafsson
Contributor

danielgustafsson commented Apr 25, 2018

This extends the INDENTATION case to also handle else statements and require proper indentation on the following line. Included are also fixes for the offending cases found in the codebase.

@jay

This comment has been minimized.

Show comment Hide comment
@jay

jay Apr 25, 2018

Member

does it allow for this:

#ifdef MACRO
  if(foo) {
    bar();
  }
  else
#endif
  {
    qux();
  }
Member

jay commented Apr 25, 2018

does it allow for this:

#ifdef MACRO
  if(foo) {
    bar();
  }
  else
#endif
  {
    qux();
  }

@jay jay added the build label Apr 25, 2018

@danielgustafsson

This comment has been minimized.

Show comment Hide comment
@danielgustafsson

danielgustafsson Apr 25, 2018

Contributor
Contributor

danielgustafsson commented Apr 25, 2018

@bagder

This comment has been minimized.

Show comment Hide comment
@bagder

bagder Apr 26, 2018

Member

This change seems to detect more (unfixed) problems! =)

./stub_gssapi.c:327:8: warning: not indented 2 steps, uses 3) (INDENTATION)
        return GSS_S_FAILURE;
        ^
Member

bagder commented Apr 26, 2018

This change seems to detect more (unfixed) problems! =)

./stub_gssapi.c:327:8: warning: not indented 2 steps, uses 3) (INDENTATION)
        return GSS_S_FAILURE;
        ^
@bagder

This comment has been minimized.

Show comment Hide comment
@bagder

bagder Apr 26, 2018

Member

BTW, the error message seems to use a single right parenthesis weirdly there.

Member

bagder commented Apr 26, 2018

BTW, the error message seems to use a single right parenthesis weirdly there.

danielgustafsson added some commits Apr 25, 2018

checksrc: force indentation of lines after an else
This extends the INDENTATION case to also handle 'else' statements
and require proper indentation on the following line. Also fixes the
offending cases found in the codebase.
checksrc: improve spelling of warning message
The INDENTATION message had unbalanced parenthesis, fix by putting
the actual indentation level in parenthesis.
@danielgustafsson

This comment has been minimized.

Show comment Hide comment
@danielgustafsson

danielgustafsson Apr 26, 2018

Contributor

Pushed a rebased and updated branch with the missing fix in stub_gssapi.c and a commit updating the error message (hadn't noticed the spelling but now I can't unsee it).

Contributor

danielgustafsson commented Apr 26, 2018

Pushed a rebased and updated branch with the missing fix in stub_gssapi.c and a commit updating the error message (hadn't noticed the spelling but now I can't unsee it).

@bagder

This comment has been minimized.

Show comment Hide comment
@bagder

bagder Apr 26, 2018

Member

Thanks!

Member

bagder commented Apr 26, 2018

Thanks!

@bagder bagder closed this in 2f13e3d Apr 26, 2018

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment