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

:sparkles: New sniff to verify that spaces are used for mid-line alignment #942

Merged
merged 2 commits into from May 7, 2017

Conversation

Projects
None yet
3 participants
@jrfnl
Contributor

jrfnl commented May 6, 2017

Tabs should be used at the beginning of the line for indentation, while spaces can be used mid-line for alignment.

This new sniff covers the second part of this rule. (The first part is already covered by the Generic.WhiteSpace.DisallowSpaceIndent sniff).

The error which is thrown is auto-fixable.

The new sniff has been added to the WordPress-Core ruleset.

Violations against this sniff in the WPCS codebase have been fixed.
Mostly involved getGroups() function example comments. Some of these have also been adjusted slightly to be in line with an earlier change (#812) in which these were missed and/or with the comment from the abstract parent class.

N.B.: I consider this sniff a candidate for pulling upstream to Generic in due time.

N.B.2: This sniff could probably do with some additional unit tests, but I couldn't think of any more, so ideas/code snippets welcome. (The run over the WPCS code base did not yield any incorrect fixes or false positives, so I'm not too worried)

jrfnl added some commits May 6, 2017

New sniff to verify that spaces are used for mid-line alignment
> Tabs should be used at the beginning of the line for indentation, while spaces can be used mid-line for alignment.

This new sniff covers the second part of this rule. (The first part is already covered by the `Generic.WhiteSpace.DisallowSpaceIndent` sniff).

The error which is thrown is auto-fixable.

The new sniff has been added to the `WordPress-Core` ruleset.
Fix violations in the WPCS codebase found by the new `DisallowInlineT…
…abs` sniff.

Also brings some function group comments inline with an earlier change and/or with the comment from the abstract parent class.
* 'lambda' => array(
* 'type' => 'error' | 'warning',
* 'message' => 'Use anonymous functions instead please!',
* 'functions' => array( 'file_get_contents', 'create_function' ),

This comment has been minimized.

@GaryJones

GaryJones May 6, 2017

Member

This seems to be an unrelated change?

@GaryJones

GaryJones May 6, 2017

Member

This seems to be an unrelated change?

This comment has been minimized.

@jrfnl

jrfnl May 6, 2017

Contributor

See above:

Mostly involved getGroups() function example comments. Some of these have also been adjusted slightly to be in line with an earlier change (#812) in which these were missed and/or with the comment from the abstract parent class.

@jrfnl

jrfnl May 6, 2017

Contributor

See above:

Mostly involved getGroups() function example comments. Some of these have also been adjusted slightly to be in line with an earlier change (#812) in which these were missed and/or with the comment from the abstract parent class.

@JDGrimes JDGrimes merged commit c0d7578 into develop May 7, 2017

2 checks passed

continuous-integration/travis-ci/pr The Travis CI build passed
Details
continuous-integration/travis-ci/push The Travis CI build passed
Details

@JDGrimes JDGrimes deleted the feature/new-use-spaces-for-alignment-sniff branch May 7, 2017

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