Skip to content

Force indentation of lines after an else in checksrc#2532

Closed
danielgustafsson wants to merge 2 commits into
curl:masterfrom
danielgustafsson:dg-checksrc-else
Closed

Force indentation of lines after an else in checksrc#2532
danielgustafsson wants to merge 2 commits into
curl:masterfrom
danielgustafsson:dg-checksrc-else

Conversation

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

danielgustafsson commented Apr 25, 2018 via email

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

3 participants