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

Generic/OpeningFunctionBraceBsdAllman: bug fix - prevent removing return types #3358

Conversation

jrfnl
Copy link
Contributor

@jrfnl jrfnl commented May 15, 2021

As reported in #3357, the Generic.Functions.OpeningFunctionBraceBsdAllman sniff would remove return types (and comments) when fixing code where blank lines existed between the end of the function declaration and the open brace.

This commit fixes that bug.

In the case of comments, the BraceSpacing error will no longer auto-fix as a dev should decide where the comment should go and/or whether it should be removed.

Includes unit tests.

Fixes #3357

Previously #1931, #1938

…urn types

As reported in 3357, the `Generic.Functions.OpeningFunctionBraceBsdAllman` sniff would remove return types (and comments) when fixing code where blank lines existed between the end of the function declaration and the open brace.

This commit fixes that bug.

In the case of comments, the `BraceSpacing` error will no longer auto-fix as a dev should decide where the comment should go and/or whether it should be removed.

Includes unit tests.

Fixes 3357
@gsherwood
Copy link
Member

Thanks for this fix

@jrfnl jrfnl deleted the feature/3357-generic-openingfunctionbracebsdallman-fixer-removes-return-type branch May 27, 2021 11:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Generic.Functions.OpeningFunctionBraceBsdAllman removes return type when additional lines are present
2 participants