Coding Standards: Upgrade WPCS to 1.0.0

WPCS 1.0.0 includes a bunch of new auto-fixers, which drops the number of coding standards issues across WordPress significantly. Prior to running the auto-fixers, there were 15,312 issues detected. With this commit, we now drop to 4,769 issues.

This change includes three notable additions:
- Multiline function calls must now put each parameter on a new line.
- Auto-formatting files is now part of the `grunt precommit` script. 
- Auto-fixable coding standards issues will now cause Travis failures.

Fixes #44600.



git-svn-id: https://develop.svn.wordpress.org/trunk@43571 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Gary Pendergast
2018-08-17 01:50:26 +00:00
parent fed48ba3fe
commit a75d153eee
549 changed files with 9936 additions and 6721 deletions
+26 -13
View File
@@ -68,7 +68,8 @@ class Tests_Meta_Register_Meta extends WP_UnitTestCase {
array(
'auth' => 10,
'sanitize' => 10,
), $has_filters
),
$has_filters
);
}
@@ -430,23 +431,35 @@ class Tests_Meta_Register_Meta extends WP_UnitTestCase {
register_meta( $type, 'registered_key1', array() );
// This will override the above registration for objects of $subtype.
register_meta( $type, 'registered_key1', array(
'object_subtype' => $subtype,
'single' => true,
) );
register_meta(
$type,
'registered_key1',
array(
'object_subtype' => $subtype,
'single' => true,
)
);
// For testing with $single => false.
register_meta( $type, 'registered_key2', array(
'object_subtype' => $subtype,
) );
register_meta(
$type,
'registered_key2',
array(
'object_subtype' => $subtype,
)
);
// Register another meta key for a different subtype.
register_meta( $type, 'registered_key3', array(
'object_subtype' => 'other_subtype',
) );
register_meta(
$type,
'registered_key3',
array(
'object_subtype' => 'other_subtype',
)
);
$object_property_name = $type . '_id';
$object_id = self::$$object_property_name;
$object_id = self::$$object_property_name;
add_metadata( $type, $object_id, 'registered_key1', 'value1' );
add_metadata( $type, $object_id, 'registered_key2', 'value2' );
@@ -473,7 +486,7 @@ class Tests_Meta_Register_Meta extends WP_UnitTestCase {
*/
public function test_get_object_subtype( $type, $expected_subtype ) {
$object_property_name = $type . '_id';
$object_id = self::$$object_property_name;
$object_id = self::$$object_property_name;
$this->assertSame( $expected_subtype, get_object_subtype( $type, $object_id ) );
}