Skip to content
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

Conversation

danielgustafsson
Copy link
Member

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
Copy link
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
Copy link
Member Author

danielgustafsson commented Apr 25, 2018 via email

@bagder
Copy link
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
Copy link
Member

bagder commented Apr 26, 2018

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

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.
The INDENTATION message had unbalanced parenthesis, fix by putting
the actual indentation level in parenthesis.
@danielgustafsson
Copy link
Member Author

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
Copy link
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.
Labels
Development

Successfully merging this pull request may close these issues.

None yet

3 participants