Skip to content

Commit

Permalink
Switch to Generic.VersionControl.GitMergeConflict
Browse files Browse the repository at this point in the history
Removes WordPressVIPMinimum.VersionControl.MergeConflict sniff.

The merge conflict boundary detection sniff in the built-in Generic standard is a more comprehensive sniff, and it means one less thing for VIP to maintain.

Requires PHPCS 3.4+ (made a requirement in #484).

Fixes #330.
  • Loading branch information
GaryJones committed Jul 3, 2020
1 parent f726c12 commit b537522
Show file tree
Hide file tree
Showing 8 changed files with 17 additions and 173 deletions.
14 changes: 5 additions & 9 deletions WordPress-VIP-Go/ruleset-test.inc
Original file line number Diff line number Diff line change
Expand Up @@ -567,12 +567,8 @@ $_SERVER['HTTP_X_FORWARDED_FOR']; // Error.
$_SERVER["REMOTE_ADDR"]; // Error.
// phpcs:enable WordPress.Security.ValidatedSanitizedInput.InputNotValidated,WordPress.Security.ValidatedSanitizedInput.InputNotSanitized

// WordPressVIPMinimum.VersionControl.MergeConflict
function is_prime( $n ) {
if ( 2 === $n ) {
}
//phpcs:ignore Generic.PHP.Syntax.PHPSyntax
======= // Error.
if ( $n % 2 === 0 ) {
}
}
// Generic.VersionControl.GitMergeConflict
?>
<<<<<<< HEAD // Error.

>>>>>>> // Error.
3 changes: 2 additions & 1 deletion WordPress-VIP-Go/ruleset-test.php
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,8 @@
565 => 1,
566 => 1,
567 => 1,
575 => 1,
572 => 1,
574 => 1,
],
'warnings' => [
4 => 1,
Expand Down
98 changes: 0 additions & 98 deletions WordPressVIPMinimum/Sniffs/VersionControl/MergeConflictSniff.php

This file was deleted.

13 changes: 0 additions & 13 deletions WordPressVIPMinimum/Tests/VersionControl/MergeConflictUnitTest.inc

This file was deleted.

41 changes: 0 additions & 41 deletions WordPressVIPMinimum/Tests/VersionControl/MergeConflictUnitTest.php

This file was deleted.

15 changes: 6 additions & 9 deletions WordPressVIPMinimum/ruleset-test.inc
Original file line number Diff line number Diff line change
Expand Up @@ -604,15 +604,12 @@ function foo() {
$c = compact( $a, $b ); // Warning x 2.
}

// WordPressVIPMinimum.VersionControl.MergeConflict
function is_prime( $n ) {
if ( 2 === $n ) {
}
//phpcs:ignore Generic.PHP.Syntax.PHPSyntax
======= // Error.
if ( $n % 2 === 0 ) {
}
}
// Generic.VersionControl.GitMergeConflict
?>
<<<<<<< HEAD // Error.

>>>>>>> // Error.
<?php

// Squiz.WhiteSpace.SuperfluousWhitespace
// Error. ?>
Expand Down
5 changes: 3 additions & 2 deletions WordPressVIPMinimum/ruleset-test.php
Original file line number Diff line number Diff line change
Expand Up @@ -206,8 +206,9 @@
595 => 1,
596 => 1,
597 => 1,
612 => 1,
618 => 1,
609 => 1,
611 => 1,
615 => 1,
],
'warnings' => [
32 => 1,
Expand Down
1 change: 1 addition & 0 deletions WordPressVIPMinimum/ruleset.xml
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@
</properties>
</rule>

<rule ref="Generic.VersionControl.GitMergeConflict"/>
<rule ref="Generic.NamingConventions.ConstructorName"/>
<rule ref="Generic.PHP.DisallowShortOpenTag"/>
<!-- Covers rule: Omitting the closing PHP tag at the end of a file is preferred. -->
Expand Down

0 comments on commit b537522

Please sign in to comment.