Skip to content

Commit b537522

Browse files
committed
Switch to Generic.VersionControl.GitMergeConflict
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.
1 parent f726c12 commit b537522

File tree

8 files changed

+17
-173
lines changed

8 files changed

+17
-173
lines changed

WordPress-VIP-Go/ruleset-test.inc

Lines changed: 5 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -567,12 +567,8 @@ $_SERVER['HTTP_X_FORWARDED_FOR']; // Error.
567567
$_SERVER["REMOTE_ADDR"]; // Error.
568568
// phpcs:enable WordPress.Security.ValidatedSanitizedInput.InputNotValidated,WordPress.Security.ValidatedSanitizedInput.InputNotSanitized
569569

570-
// WordPressVIPMinimum.VersionControl.MergeConflict
571-
function is_prime( $n ) {
572-
if ( 2 === $n ) {
573-
}
574-
//phpcs:ignore Generic.PHP.Syntax.PHPSyntax
575-
======= // Error.
576-
if ( $n % 2 === 0 ) {
577-
}
578-
}
570+
// Generic.VersionControl.GitMergeConflict
571+
?>
572+
<<<<<<< HEAD // Error.
573+
574+
>>>>>>> // Error.

WordPress-VIP-Go/ruleset-test.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,8 @@
115115
565 => 1,
116116
566 => 1,
117117
567 => 1,
118-
575 => 1,
118+
572 => 1,
119+
574 => 1,
119120
],
120121
'warnings' => [
121122
4 => 1,

WordPressVIPMinimum/Sniffs/VersionControl/MergeConflictSniff.php

Lines changed: 0 additions & 98 deletions
This file was deleted.

WordPressVIPMinimum/Tests/VersionControl/MergeConflictUnitTest.inc

Lines changed: 0 additions & 13 deletions
This file was deleted.

WordPressVIPMinimum/Tests/VersionControl/MergeConflictUnitTest.php

Lines changed: 0 additions & 41 deletions
This file was deleted.

WordPressVIPMinimum/ruleset-test.inc

Lines changed: 6 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -604,15 +604,12 @@ function foo() {
604604
$c = compact( $a, $b ); // Warning x 2.
605605
}
606606

607-
// WordPressVIPMinimum.VersionControl.MergeConflict
608-
function is_prime( $n ) {
609-
if ( 2 === $n ) {
610-
}
611-
//phpcs:ignore Generic.PHP.Syntax.PHPSyntax
612-
======= // Error.
613-
if ( $n % 2 === 0 ) {
614-
}
615-
}
607+
// Generic.VersionControl.GitMergeConflict
608+
?>
609+
<<<<<<< HEAD // Error.
610+
611+
>>>>>>> // Error.
612+
<?php
616613

617614
// Squiz.WhiteSpace.SuperfluousWhitespace
618615
// Error. ?>

WordPressVIPMinimum/ruleset-test.php

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -206,8 +206,9 @@
206206
595 => 1,
207207
596 => 1,
208208
597 => 1,
209-
612 => 1,
210-
618 => 1,
209+
609 => 1,
210+
611 => 1,
211+
615 => 1,
211212
],
212213
'warnings' => [
213214
32 => 1,

WordPressVIPMinimum/ruleset.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,7 @@
4242
</properties>
4343
</rule>
4444

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

0 commit comments

Comments
 (0)