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

New Generic.WhiteSpace.IncrementDecrementSpacing sniff #2174

Commits on Oct 1, 2018

  1. ✨ New Generic.WhiteSpace.IncrementDecrementSpacing sniff

    New sniff to check that there are no spaces (or comments) between an incrementor/decrementor and the variable it applies to.
    
    The sniff can examine both PHP as well as JS files for this, though I suspect there may be some false positive reports for JS at some point as `T_STRING` is quite a generic token to check for.
    
    Includes unit tests.
    Includes auto-fixer.
    Includes code-consistency metrics.
    
    I've made a conscious decision to not make the number of spaces accepted between the in/decrementor and the variable configurable as it is a widely accepted convention that there should be no spaces between them.
    If it would be so desired, I can add a public property to make this configurable.
    
    Fixes 2172
    jrfnl committed Oct 1, 2018
    Configuration menu
    Copy the full SHA
    1e1edb2 View commit details
    Browse the repository at this point in the history