Skip to content

Travis: Add simple test for fixer conflicts to the build script #1196

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

Merged
merged 1 commit into from
Oct 12, 2017

Conversation

jrfnl
Copy link
Member

@jrfnl jrfnl commented Oct 12, 2017

Now squizlabs/PHP_CodeSniffer#1645 has been merged, I can pull the follow up PR to #1123.

By running the complete WPCS suite over the test case files, we should be able to catch at least some fixer conflicts early.

As PHPCS exits with an error code of 1 when all fixable errors have been fixed correctly, we need to run the command twice over the test files to get a 0 exit code allowing the build to pass.

Any other error code indicates a fixer conflict or other problem remaining.

The travis report will output a summary report which will indicate the files which "FAILED TO FIX" which can be used to start investigating the fixer conflict.

By running the complete WPCS suite over the test case files, we should be able to catch at least some fixer conflicts early.

The exit code should be 1 when all fixable errors have been fixed.
The exit code will be 2 when not all fixable errors have been fixed, indicating a fixer conflict.

The command will output a summary report which will indicate the files which "FAILED TO FIX".
@GaryJones GaryJones merged commit 4c9570e into develop Oct 12, 2017
@GaryJones GaryJones deleted the feature/travis-test-for-fixer-conflicts branch October 12, 2017 13:29
@jrfnl jrfnl added this to the 0.14.0 milestone Oct 12, 2017
@jrfnl
Copy link
Member Author

jrfnl commented Oct 15, 2017

FYI: I'm talking with Greg about adding the same test against fixer conflicts upstream.

An initial test run for fixer conflicts with the various upstream rulesets has identified nearly a hundred fixer conflicts.
I'm trying to isolate the issues and am sending in patches for them.
A first group of PRs have already been submitted https://github.com/squizlabs/PHP_CodeSniffer/pulls - tickets 1706, 1707, 1708, 1710, 1712, 1713, 1714 and 1716.

Quite a few of the bugs I have identified involve sniffs used within WPCS, so the fixes might well (positively) affect the WP core project. /cc @pento

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.

3 participants