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

Why WhiteSpace.ControlStructureSpacing include check for T_FUNCTION #1383

Closed
ngocphamm opened this issue Jun 22, 2018 · 2 comments
Closed

Why WhiteSpace.ControlStructureSpacing include check for T_FUNCTION #1383

ngocphamm opened this issue Jun 22, 2018 · 2 comments

Comments

@ngocphamm
Copy link

https://github.com/WordPress-Coding-Standards/WordPress-Coding-Standards/blob/cca93a6713881c684e38c1a226ea64944e5ddf1a/WordPress/Sniffs/WhiteSpace/ControlStructureSpacingSniff.php#L98

This will result in an error for having an opening brace in a new line, at function declaration level

Opening brace should be on the same line as the declaration

While this should be checked by either Generic.Functions.OpeningFunctionBraceKernighanRitchie (included in this WP standard set), or Generic.Functions.OpeningFunctionBraceBsdAllman already.

It took me a few hours to figure this out, as I tried to exclude the rule Generic.Functions.OpeningFunctionBraceKernighanRitchie yet still see the error.

Yes, I am aware that this is the standard sets for WordPress, thus the "standard" should be having the opening brace in the same line with the function declaration, but I think this might be a bug. Please correct me if I'm wrong, because I'm totally new to this.

@jrfnl
Copy link
Member

jrfnl commented Jun 23, 2018

Duplicate of #1101 ?

@ngocphamm
Copy link
Author

Hmm I think so. Sorry for not searching before making the issue. Will close this.

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

No branches or pull requests

2 participants