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

Squiz.WhiteSpace.FunctionSpacing is removing indents from the start of functions when fixing #2110

Commits on Aug 3, 2018

  1. Squiz/FunctionSpacing: don't remove indentation before start of function

    When too many blank lines are found before a function, the `Before/BeforeFirst` fixer would unnecessarily also remove the indentation of the `$nextContent` line, meaning that this sniff would **always** need to be accompanied by one or more sniffs to fix the indentation again.
    
    As this sniff is about blank lines between functions, not about indentation, I consider this a bug.
    
    This minor change fixes it.
    
    Includes unit tests demonstrating the issue.
    jrfnl committed Aug 3, 2018
    Configuration menu
    Copy the full SHA
    87f1f48 View commit details
    Browse the repository at this point in the history

Commits on Aug 6, 2018

  1. Squiz/FunctionSpacing: don't remove indentation before start of function

    When too few blank lines are found before a function, the `Before/BeforeFirst` fixer would unnecessarily also remove the indentation of the `$nextContent` line and leave the indentation on the newly added blank line, meaning that this sniff would **always** need to be accompanied by one or more sniffs to fix the indentation again and to remove trailing whitespace.
    
    As this sniff is about blank lines between functions, not about indentation, I consider this a bug.
    
    This minor change fixes it.
    
    Includes unit tests demonstrating the issue.
    jrfnl committed Aug 6, 2018
    Configuration menu
    Copy the full SHA
    5d1e7b2 View commit details
    Browse the repository at this point in the history