New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Force indentation of lines after an else in checksrc #2532

Closed
wants to merge 2 commits into
base: master
from

Conversation

Projects
None yet
3 participants
@danielgustafsson
Member

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.

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.

Member

danielgustafsson commented Apr 25, 2018

@bagder

This comment has been minimized.

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.

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.

Member

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.

Member

bagder commented Apr 26, 2018

Thanks!

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

@lock lock bot locked as resolved and limited conversation to collaborators Jul 25, 2018

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