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 Universal.WhiteSpace.DisallowInlineTabs sniff #43

Merged
merged 1 commit into from
Mar 31, 2020

Commits on Mar 31, 2020

  1. ✨ New Universal.WhiteSpace.DisallowInlineTabs sniff

    New sniff to enforce using spaces for mid-line alignment.
    
    While tab versus space based indentation is a question of preference, for mid-line alignment, spaces should always be preferred, as using tabs will result in inconsistent formatting depending on the dev-user's chosen tab width.
    
    > _This sniff is especially useful for tab-indentation based standards which use the `Generic.Whitespace.DisallowSpaceIndent` sniff to enforce this._
    >
    > **DO** make sure to set the PHPCS native `tab-width` configuration for the best results.
    > ```xml
    >    <arg name="tab-width" value="4"/>
    > ```
    >
    > The PHPCS native `Generic.Whitespace.DisallowTabIndent` sniff (used for space-based standards) oversteps its reach and silently does mid-line tab to space replacements as well.
    >
    > However, the sister-sniff `Generic.Whitespace.DisallowSpaceIndent` leaves mid-line tabs/spaces alone.
    > This sniff fills that gap.
    
    Implementation notes:
    * Includes a `DummyTokenizer` to allow use of the PHPCS native intelligent tabs to spaces replacement using the default tab-width if none was set.
    
    Includes fixers.
    Includes unit tests.
    Includes documentation.
    jrfnl committed Mar 31, 2020
    Configuration menu
    Copy the full SHA
    25e84d4 View commit details
    Browse the repository at this point in the history