Part of #2571965: [meta] Fix PHP coding standards in core.

Approach

We are testing coding standards with PHP CodeSniffer, using the Drupal coding standards from the Coder module. Both of these packages are not installed in Drupal core. We need to do a couple of steps in order to download and configure them so we can run a coding standards check.

Step 1: Add the coding standard to the whitelist

Every coding standard is identified by a "sniff". For example, an imaginary coding standard that would require all llamas to be placed inside a square bracket fence would be called the "Drupal.AnimalControlStructure.BracketedFence sniff". There are dozens of such coding standards, and to make the work easier we have started by only whitelisting the sniffs that pass. For the moment all coding standards that are not yet fixed are simply skipped during the test.

Open the file core/phpcs.xml.dist and add a line for the sniff of this ticket. The sniff name is in the issue title. Make sure your patch will include the addition of this line.

Step 2: Install PHP CodeSniffer and the ruleset from the Coder module

Both of these packages are not installed by default in Drupal core, so we need to download them. This can be done with Composer, from the root folder of your Drupal installation:

$ composer require drupal/coder squizlabs/php_codesniffer
$ ./vendor/bin/phpcs --config-set installed_paths ../../drupal/coder/coder_sniffer

Once you have installed the phpcs package, you can list all the sniffs available to you like this:

$ ./vendor/bin/phpcs --standard=Drupal -e

This will give you a big list of sniffs, and the Drupal-based ones should be present.

Step 3: Prepare the phpcs.xml file

To speed up the testing you should make a copy of the file phpcs.xml.dist (in the core/ folder) and save it as phpcs.xml. This is the configuration file for PHP CodeSniffer.

We only want this phpcs.xml file to specify the sniff we're interested in. So we need to remove all the rule items, and add only our own sniff's rule. Rule items look like this:

<rule ref="Drupal.Classes.UnusedUseStatement"/>

Remove all of them, and add only the sniff from this issue title. This will make sure that our tests run quickly, and are not going to contain any output from unrelated sniffs.

Step 4: Run the test

Now you are ready to run the test! From within the core/ folder, run the following command to launch the test:

$ cd core/
$ ../vendor/bin/phpcs -p

This takes a couple of minutes. The -p flag shows the progress, so you have a bunch of nice dots to look at while it is running.

Step 5: Fix the failures

When the test is complete it will present you a list of all the files that contain violations of your sniff, and the line numbers where the violations occur. You could fix all of these manually, but thankfully phpcbf can fix many of them. You can call phpcbf like this:

$ ../vendor/bin/phpcbf

This will fix the errors in place. You can then make a diff of the changes using git. You can also re-run the test with phpcs and determine if that fixed all of them.

CommentFileSizeAuthor
#88 drupal-coding-standards-2715485-88.patch98.55 KBMalevi4
#88 interdiff-78-88.txt67.14 KBMalevi4
#78 drupal-coding-standards-2715485-78.patch32.97 KBmfernea
#73 drupal-coding-standards-2715485-73.patch1.28 KBmfernea
#59 drupal-coding-standards-2715485-59.patch34.32 KBmfernea
#55 drupal-coding-standards-2715485-54.png35.86 KBtiago.urbano
#54 2715485-54.patch34.6 KBjofitz
#52 drupal-coding-standards-2715485-52.patch34.81 KBmfernea
#46 interdiff-43-46.txt1.1 KBharsha012
#46 2715485-46.patch34.6 KBharsha012
#43 interdiff-37-43.txt3.96 KBharsha012
#43 2715485-43.patch34.07 KBharsha012
#40 interdiff-37-40.txt169.86 KBharsha012
#40 2715485-40.patch222.33 KBharsha012
#37 interdiff-34-37.txt2.09 KBharsha012
#37 2715485-37.patch33.9 KBharsha012
#34 2715485-34.patch34.53 KBrajeevk
#32 interdiff.txt646 byteshimanshu-dixit
#32 2715485-32.patch29.91 KBhimanshu-dixit
#30 interdiff.txt692 byteshimanshu-dixit
#30 2715485-30.patch29.91 KBhimanshu-dixit
#27 interdiff-20-27.txt4.4 KBtameeshb
#27 2715485-27.patch29.91 KBtameeshb
#20 2715485-20.patch30.13 KBimalabya
#19 2715485-19.patch30.13 KBimalabya
#18 2715485-13-18.txt673 bytesimalabya
#18 2715485-18.patch29.29 KBimalabya
#13 Drupal.Commenting.InlineComment-NoSpaceBefore-2715485-13.patch29.07 KBvprocessor
#9 Drupal.Commenting.InlineComment-NoSpaceBefore-2715485-9.patch29.07 KBvprocessor
#2 2715485_2.patch30.19 KBMile23
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

Mile23 created an issue. See original summary.

Mile23’s picture

Version: 9.x-dev » 8.2.x-dev
Issue summary: View changes
Status: Active » Needs review
Issue tags: -rc eligible
FileSize
30.19 KB

Le Patch.

Mile23’s picture

Status: Needs review » Needs work

Kicking the testbot...

Mile23’s picture

Status: Needs work » Needs review
Mile23’s picture

Ah well, no testbot.

There are a bunch of @todos in the patch, so I followed up on them, and added this one to connect the dots: #2715507: @todo: Modify core/profiles/standard/src/Tests/StandardTest.php

pfrenssen’s picture

Issue summary: View changes
dawehner’s picture

Status: Needs review » Needs work
  1. +++ b/core/modules/taxonomy/src/Plugin/views/filter/TaxonomyIndexTidDepth.php
    @@ -54,7 +54,7 @@ public function query() {
    -      $operator = 'IN';# " IN (" . implode(', ', array_fill(0, sizeof($this->value), '%d')) . ")";
    +      $operator = 'IN';// " IN (" . implode(', ', array_fill(0, sizeof($this->value), '%d')) . ")";
         }
    

    IMHO we should move that onto the previous line

  2. +++ b/core/modules/views/src/Tests/Plugin/ArgumentDefaultTest.php
    @@ -127,7 +127,7 @@ public function testArgumentDefaultFixed() {
       /**
        * @todo Test php default argument.
        */
    -  //function testArgumentDefaultPhp() {}
    +  // function testArgumentDefaultPhp() {}
    

    Let's remove this code

  3. +++ b/core/tests/Drupal/KernelTests/Core/Database/LoggingTest.php
    @@ -64,7 +64,7 @@ function testEnableTargetLogging() {
    -    db_query('SELECT age FROM {test} WHERE name = :name', array(':name' => 'Ringo'), array('target' => 'replica'));//->fetchCol();
    +    db_query('SELECT age FROM {test} WHERE name = :name', array(':name' => 'Ringo'), array('target' => 'replica'));// ->fetchCol();
    

    Let's remove this pointless comment as well

  4. +++ b/core/tests/Drupal/KernelTests/Core/Entity/EntityDefinitionUpdateTest.php
    @@ -104,7 +104,7 @@ public function testEntityTypeUpdateWithoutData() {
    -    $this->assertEqual($this->entityDefinitionUpdateManager->getChangeSummary(), $expected); //, 'EntityDefinitionUpdateManager reports the expected change summary.');
    +    $this->assertEqual($this->entityDefinitionUpdateManager->getChangeSummary(), $expected); // , 'EntityDefinitionUpdateManager reports the expected change summary.');
    

    Move on top

vprocessor’s picture

Assigned: Unassigned » vprocessor
vprocessor’s picture

rerolled & fixed according with dawehner comment #7

vprocessor’s picture

Assigned: vprocessor » Unassigned
Status: Needs work » Needs review

Status: Needs review » Needs work

The last submitted patch, 9: Drupal.Commenting.InlineComment-NoSpaceBefore-2715485-9.patch, failed testing.

vprocessor’s picture

Assigned: Unassigned » vprocessor
vprocessor’s picture

Assigned: vprocessor » Unassigned
Status: Needs work » Needs review
FileSize
29.07 KB

rerolled

Mile23’s picture

Status: Needs review » Needs work

So. Much. Commented. Code. :-(

  1. +++ b/core/modules/views/src/Tests/Plugin/ArgumentDefaultTest.php
    @@ -125,11 +125,6 @@ public function testArgumentDefaultFixed() {
     
       /**
    -   * @todo Test php default argument.
    -   */
    -  //function testArgumentDefaultPhp() {}
    -
    -  /**
        * Test node default argument.
    

    If Simpletest had a way to mark a test as incomplete, I'd say we should do that here. Otherwise we should move the @todo to the class docblock.

Also phpcs says this.. (note that it's commented code..)

FILE: ...lTests/Core/Entity/Element/EntityAutocompleteElementFormTest.php
----------------------------------------------------------------------
FOUND 1 ERROR AFFECTING 1 LINE
----------------------------------------------------------------------
 321 | ERROR | [x] No space found before comment text; expected "// $form
     |       |     = $form_builder->getForm($this);" but found "//$form =
     |       |     $form_builder->getForm($this);"
     |       |     (Drupal.Commenting.InlineComment.NoSpaceBefore)
----------------------------------------------------------------------
PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
----------------------------------------------------------------------
dawehner’s picture

Issue tags: +Novice

To be clear, removing this test is 100% fine, we don't have this PHP argument_default plugin anymore.

Novice to fix the issue pointed out by mile23

Version: 8.2.x-dev » 8.3.x-dev

Drupal 8.2.0-beta1 was released on August 3, 2016, which means new developments and disruptive changes should now be targeted against the 8.3.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

mradcliffe’s picture

Issue tags: +Dublin2016

Tasks that remain:

1. Make the fix suggested by mile23, which is to remove the argument default test and move the doc block.

imalabya’s picture

Status: Needs work » Needs review
FileSize
29.29 KB
673 bytes

Added patch for 8.3.x

imalabya’s picture

Re-uploading. Missed phpcs.xml.dist changes.

imalabya’s picture

Just noticed. Missed out @dawehner comments #7

Final patch from my end now.

dawehner’s picture

@malavya Ensure to create interdiffs in the future.

Version: 8.3.x-dev » 8.4.x-dev

Drupal 8.3.0-alpha1 will be released the week of January 30, 2017, which means new developments and disruptive changes should now be targeted against the 8.4.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

klausi’s picture

Status: Needs review » Needs work
  1. +++ b/core/modules/taxonomy/src/Plugin/views/filter/TaxonomyIndexTidDepth.php
    @@ -54,7 +54,8 @@ public function query() {
    -      $operator = 'IN';# " IN (" . implode(', ', array_fill(0, sizeof($this->value), '%d')) . ")";
    +      // " IN (" . implode(', ', array_fill(0, sizeof($this->value), '%d')) . ")";
    +      $operator = 'IN';
    

    Not really useful to keep this comment without explaining what this even is? I would remove it.

  2. +++ b/core/tests/Drupal/KernelTests/Core/Entity/EntityDefinitionUpdateTest.php
    @@ -104,7 +104,8 @@ public function testEntityTypeUpdateWithoutData() {
    -    $this->assertEqual($this->entityDefinitionUpdateManager->getChangeSummary(), $expected); //, 'EntityDefinitionUpdateManager reports the expected change summary.');
    +    // , 'EntityDefinitionUpdateManager reports the expected change summary.');
    +    $this->assertEqual($this->entityDefinitionUpdateManager->getChangeSummary(), $expected);
    

    That comment is not really useful, let's just remove it?

pfrenssen’s picture

Version: 8.4.x-dev » 8.3.x-dev

So this seems to detect a whole bunch of commented out code that is left in our code base. Let's make some followups to get rid of it.

Mile23’s picture

Version: 8.3.x-dev » 8.4.x-dev

8.3.x is in alpha now.

pfrenssen’s picture

Yes but coding standards fixes are acceptable right up to 8.3.0-RCx.

tameeshb’s picture

/v/w/h/drupal83> 
git apply --index 2715485-20.patch
error: patch failed: core/tests/Drupal/KernelTests/Core/Entity/EntityDefinitionUpdateTest.php:104
error: core/tests/Drupal/KernelTests/Core/Entity/EntityDefinitionUpdateTest.php: patch does not apply

Rerolled and made changes from #24

tameeshb’s picture

Status: Needs work » Needs review
klausi’s picture

Status: Needs review » Needs work

Thanks, looks like you forgot to fix CommentResourceTestBase.php which shows up with 6 errors after I run phpcs on core.

  1. +++ b/core/modules/quickedit/tests/src/Kernel/MetadataGeneratorTest.php
    @@ -172,7 +172,7 @@ public function testEditorWithCustomMetadata() {
    -    $this->assertEqual($expected, $metadata); //, 'The correct metadata (including custom metadata) is generated.');
    +    $this->assertEqual($expected, $metadata); // , 'The correct metadata (including custom metadata) is generated.');
    

    Comments should not appear after statements. I think we should move the commented out message just as normal comment to the line before.

himanshu-dixit’s picture

Assigned: Unassigned » himanshu-dixit
Status: Needs work » Needs review
FileSize
29.91 KB
692 bytes

Here is the patch that i made. I also changed, this line

// , 'The correct metadata (including custom metadata) is generated.');

to

// 'The correct metadata (including custom metadata) is generated.');

I don't understand what's the need for , here.

klausi’s picture

Status: Needs review » Needs work

The comment was just commented out code from the assertion call where you can pass a third parameter as message.

+++ b/core/modules/quickedit/tests/src/Kernel/MetadataGeneratorTest.php
@@ -172,7 +172,8 @@ public function testEditorWithCustomMetadata() {
-    $this->assertEqual($expected, $metadata); // , 'The correct metadata (including custom metadata) is generated.');
+    // 'The correct metadata (including custom metadata) is generated.');
+    $this->assertEqual($expected, $metadata);

Cool, can you also remove "');" at the end?

himanshu-dixit’s picture

Status: Needs work » Needs review
FileSize
29.91 KB
646 bytes

Here is the new patch.

klausi’s picture

Status: Needs review » Needs work
+++ b/core/modules/quickedit/tests/src/Kernel/MetadataGeneratorTest.php
@@ -172,7 +172,7 @@ public function testEditorWithCustomMetadata() {
-    // 'The correct metadata (including custom metadata) is generated.');
+    // , 'The correct metadata (including custom metadata) is generated.'.

No, you should remove the quotes and the "," to make it look like a normal comment.

And I don't see the required changes to CommentResourceTestBase in this patch. Can you run ../vendor/bin/phpcs in the core directory and make sure its output is empty before you post the next patch. Thanks!

rajeevk’s picture

Assigned: himanshu-dixit » Unassigned
Status: Needs work » Needs review
FileSize
34.53 KB

Version: 8.4.x-dev » 8.5.x-dev

Drupal 8.4.0-alpha1 will be released the week of July 31, 2017, which means new developments and disruptive changes should now be targeted against the 8.5.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

mfernea’s picture

Status: Needs review » Needs work

This needs work as the required phpcs.xml.dist are not correct.

harsha012’s picture

Status: Needs work » Needs review
FileSize
33.9 KB
2.09 KB

fixed the phpcs.xml.dist

mfernea’s picture

Status: Needs review » Needs work

Please check the test results. There are 378 cs violations.

mfernea’s picture

Actually we are not excluding enough sniffs. I would go for these lines in phpcs.xml.dist:

  <rule ref="../vendor/drupal/coder/coder_sniffer/Drupal/Sniffs/Commenting/InlineCommentSniff.php">
    <!-- Sniff for: NoSpaceBefore, WrongStyle -->
    <exclude name="Drupal.Commenting.InlineComment.DocBlock"/>
    <exclude name="Drupal.Commenting.InlineComment.InvalidEndChar"/>
    <exclude name="Drupal.Commenting.InlineComment.NotCapital"/>
    <exclude name="Drupal.Commenting.InlineComment.SpacingAfter"/>
    <exclude name="Drupal.Commenting.InlineComment.SpacingBefore"/>
  </rule>

Other notes:

  • Please don't remove public from functions' definitions (ForumTest and AliasTest 2 places)
  • Make the comment from MetadataGeneratorTest look like a real comment - no quotes. That text was the initial assertEqual's third param ($message).
  • I don't think that modifications from ArgumentDefaultTest.php are ok. I would just add the required space.
  • In EntityDefinitionUpdateTest keep the comment just like in MetadataGeneratorTest.
harsha012’s picture

Status: Needs work » Needs review
FileSize
222.33 KB
169.86 KB

@mfernea not sure about the below line

I don't think that modifications from ArgumentDefaultTest.php are ok. I would just add the required space.

fixed 378 cs issue and also fixed the other point.

Status: Needs review » Needs work

The last submitted patch, 40: 2715485-40.patch, failed testing. View results

mfernea’s picture

Hmm... actually you should have only modified phpcs.xml.dist as you did, but not fix the 378 cs issues. They wouldn't have been raised again. Also, they are not related to the sniffs we are fixing in this issue, mentioned in the title.
My suggestion would be to start from the patch at #37, do the modifications from #39 and see what else pops up. Also post an interdiff between the new patch and #37.

Looking at the interdiff between #37 and #40 regarding the issues mentioned in #39 the modifications look good.
Regarding ArgumentDefaultTest.php:
I would only add the space after "//": //function testArgumentDefaultPhp() {} -> // function testArgumentDefaultPhp() {}

harsha012’s picture

@mfernea

fixed as per your comment.

harsha012’s picture

Status: Needs work » Needs review
mfernea’s picture

Status: Needs review » Needs work

Looks good.

In the latest patch testArgumentDefaultNode function's comment was removed and it triggers a cs error. The comment was:

/**
 * Test node default argument.
 */

Also, if I look at the test results I notice one extra cs issue.

harsha012’s picture

Status: Needs work » Needs review
FileSize
34.6 KB
1.1 KB

@mfernea

fixed as per the comment

Status: Needs review » Needs work

The last submitted patch, 46: 2715485-46.patch, failed testing. View results

cburschka’s picture

cburschka’s picture

Is this identical to #2719649: Fix 'Drupal.Commenting.InlineComment.SpacingBefore' coding standard? The patch seems to be targeting the same lines.

mfernea’s picture

Status: Needs review » Reviewed & tested by the community

Good work! The patch looks fine. Applies cleanly. No cs errors.

@harsha012: Maybe one more thing, but less important. Add back the empty line after:

// function testArgumentDefaultPhp() {}

@cburschka: If I apply this patch there are still a lot of SpacingBefore issues. SpacingBefore focuses on indentation.

Status: Reviewed & tested by the community » Needs work

The last submitted patch, 46: 2715485-46.patch, failed testing. View results

mfernea’s picture

Status: Needs work » Needs review
FileSize
34.81 KB

Quick re-roll. I also added back the blank line mentioned at #50.

Status: Needs review » Needs work

The last submitted patch, 52: drupal-coding-standards-2715485-52.patch, failed testing. View results

jofitz’s picture

Status: Needs work » Needs review
FileSize
34.6 KB

Re-rolled patch from #46 and re-added the blank line mentioned in #50 (same as was attempted in #52).

tiago.urbano’s picture

Status: Needs review » Needs work
Issue tags: +ciandt-contrib
FileSize
35.86 KB

Comments should start with capital letter and ends with full stop
Comments should start with capital letter and end with full stops.

-        //empty directory - returns false
+        // Empty directory - returns false.
mfernea’s picture

Status: Needs work » Reviewed & tested by the community

@tiago.urbano We are not targeting those sniffs in this patch. As you can see in the phpcs.xml.dist Drupal.Commenting.InlineComment.InvalidEndChar and Drupal.Commenting.InlineComment.NotCapital are excluded. They are handled in other issues.

Patch looks good. No cs issues. RTBC.

xjm’s picture

Status: Reviewed & tested by the community » Needs work

So this patch mixes several different kinds of fixes to comments and fixes several rules in a single patch, which isn't the best issue scope per https://www.drupal.org/core/scope. It's mostly adding a space between the double slash and words, but there are some places that are moved to the line before and several places that are removing commented code entirely. We shouldn't do that -- each place where there is commented code should probably have a git blame and be discussed separately.

Keep in mind that coding standards issues are often best reviewed with word diffs. git diff --color-words would show nothing for the majority of this patch where it's just fixing whitespace, but then there are a number of places where it shows something and then the reviewer has to switch contexts to think about the lines and do research into why they are being removed.

+++ b/core/modules/comment/src/Plugin/views/sort/Thread.php
@@ -16,14 +16,14 @@ class Thread extends SortPluginBase {
-      //@todo is this secure?
+      // @todo is this secure?

Aside: This is a terrifying comment to read.

Can we make this patch a patch that just fixes the comment initial whitespace rule, have a different issue that fixes the "comment on its own line" rule, and have separate issues that discuss removing the commented-out code rather than doing it in this patch, with research into why the commented code is there in the first place?

I've removed issue credit for @tiago.urbano because that review is out of scope for this issue, and attaching screenshots of patches applied to code is not helpful. I've also removed credit for @RajeevK since they only attached a patch that did not apply and did not address feedback. In the future, please read the issue carefully to ensure you are helping make progress on it, so that you can receive issue credit. Thanks!

Thanks everyone for your ongoing work to clean up these coding standards and enable our coding rules for checking; it's really appreciated and will make it so we don't have to worry about these sorts of issues in the future.

mfernea’s picture

Title: Fix 'Drupal.Commenting.InlineComment.NoSpaceBefore', 'WrongStyle' coding standard » Fix 'Drupal.Commenting.InlineComment.NoSpaceBefore' coding standard

I update the issue title and opened #2909163: Fix 'Drupal.Commenting.InlineComment.WrongStyle' coding standard as a follow-up.
For commented code we can add the required space when missing.

I'm not sure what to do with commented code, as there are a lot of them. How to create new issues? Grouped or individual? Both options have downsides :).

mfernea’s picture

Status: Needs work » Needs review
FileSize
34.32 KB

Here is the updated patch.

xjm’s picture

I would lean toward one issue per API for the commented code followups. This adds some overhead for issue creation etc., but then we can use git blame, relate the past issues that commented the code, file followups if needed, and get input from the relevant subsystem maintainer. I think maybe a meta is a good idea. Then we could file issues just for the two we decided to remove here, and let the meta take care of others since this is only tangentially connected to this coding standard.

xjm’s picture

The updated patch looks like a good scope to me if some others want to review/confirm for RTBC ('cause then I can commit it). Thanks!

mfernea’s picture

Actually, the modifications that started the discussion belong to #2901572: Fix 'Drupal.Commenting.PostStatementComment' coding standard and not to #2909163: Fix 'Drupal.Commenting.InlineComment.WrongStyle' coding standard. I will add comments there on how to approach those issues.

andriyun’s picture

Status: Needs review » Reviewed & tested by the community

Patch is pretty clear for me and contains only issue sniff related changes.
Agree that we should fix other issues related to inline comment issues in proper sniff treads
Let's be sure that we create all following issues.
There is the list related follow-up issues:

+1 to RTBC

andriyun’s picture

  • xjm committed 2df73e2 on 8.5.x
    Issue #2715485 by harsha012, malavya, himanshu-dixit, mfernea,...

  • xjm committed 8f6ac68 on 8.4.x
    Issue #2715485 by harsha012, malavya, himanshu-dixit, mfernea,...
xjm’s picture

Status: Reviewed & tested by the community » Fixed
Related issues: +#2909362: [meta] Commented-out code in Drupal

Alright, thanks, this is the patch I'd expect.

  • Reviewed with a word diff and confirmed that there are no non-whitespace changes other than a couple places where we removed a tripled slash.
  • Changes in the patch all look correct.
  • There aren't any comments that would need to be rewrapped because adding the single space put them over 80 chars. (One is already over 80 chars as well as the comments at the ends of lines, but those are out of scope here.
  • Ran ../vendor/bin/phpcs -p on 8.5.x with the patch applied and confirmed there were no failures.
  • Reintroduced a failure and confirmed it would fail.
  • Ran it again on the 8.4.x backport in case the branches were different.

Committed to 8.5.x and cherry-picked to 8.4.x as a coding standards cleanup during RC.

Posted #2909362: [meta] Commented-out code in Drupal to address commented-out code. We can probably redirect some of the other issues' followups there as well.

Thanks everyone! See you in the other issues. It will be helpful if you can mention in the summaries of those issues who from this issue should also receive credit (if they participated in the discussion for how to fix that part). Thanks!

  • xjm committed 964954e on 8.5.x
    Revert "Issue #2715485 by harsha012, malavya, himanshu-dixit, mfernea,...

  • xjm committed b067576 on 8.5.x
    Revert "Revert "Issue #2715485 by harsha012, malavya, himanshu-dixit,...
xjm’s picture

Status: Fixed » Needs work

Oh darnit. This one also has diff component files changes in it. Let's please remove those hunks before committing. Thanks!

mfernea’s picture

Assigned: Unassigned » mfernea

I will handle this shortly.

mfernea’s picture

@xjm: you reverted the revert on 8.5.x, I guess you meant to revert from both branches, no?

mfernea’s picture

This would be the patch if the commit was reverted, not reverted twice. So, I'm not setting the NR status yet.

  • xjm committed 2297d51 on 8.4.x
    Revert "Issue #2715485 by harsha012, malavya, himanshu-dixit, mfernea,...

  • xjm committed cc30270 on 8.5.x
    Revert "Revert "Revert "Issue #2715485 by harsha012, malavya, himanshu-...
xjm’s picture

#fail. Thanks @mfernea. That'll teach me to use relative refs rather than the actual commit hash. :P

#73 is kind of an interdiff. Let's get the rest of the patch, without that bit. :) Thanks!

xjm’s picture

Or, we could keep going for more reverts of reverts of reverts... ;) but probably best not.

mfernea’s picture

Status: Needs work » Needs review
FileSize
32.97 KB

Here is the updated patch.

andriyun’s picture

Status: Needs review » Reviewed & tested by the community

Ok
No more changes for Diff component in patch.

git diff --color-words
show phpcs.xml.dist and few removed /

So move issue to RTBC

The last submitted patch, 73: drupal-coding-standards-2715485-73.patch, failed testing. View results

catch’s picture

Status: Reviewed & tested by the community » Needs work
+++ b/core/tests/Drupal/KernelTests/Core/Entity/EntityDefinitionUpdateTest.php
@@ -115,7 +115,7 @@ public function testEntityTypeUpdateWithoutData() {
       ],
     ];
-    $this->assertEqual($this->entityDefinitionUpdateManager->getChangeSummary(), $expected); //, 'EntityDefinitionUpdateManager reports the expected change summary.');
+    $this->assertEqual($this->entityDefinitionUpdateManager->getChangeSummary(), $expected); // , 'EntityDefinitionUpdateManager reports the expected change summary.');
 

We should remove the inline comment here - it's just commenting out the assertion message. So either kill the message altogether or uncomment it.

mfernea’s picture

We agreed with @xjm to just fix the cs issues here and open child issues of #2909362: [meta] Commented-out code in Drupal for these lines. So for the above mentioned line we have #2911166: Undo accidental commenting of message in EntityDefinitionUpdateTest. Isn't it ok?

mfernea’s picture

Assigned: mfernea » Unassigned
xjm’s picture

Status: Needs work » Reviewed & tested by the community

Yep, back to RTBC. :) Sorry for the confusion!

  • catch committed 2e18fe9 on 8.5.x
    Issue #2715485 by harsha012, mfernea, malavya, himanshu-dixit,...
catch’s picture

Version: 8.5.x-dev » 8.4.x-dev
Status: Reviewed & tested by the community » Fixed

Fair enough.

Committed/pushed to 8.5.x and cherry-picked to 8.4.x. Thanks!

  • catch committed de0ca6d on 8.4.x
    Issue #2715485 by harsha012, mfernea, malavya, himanshu-dixit,...
Malevi4’s picture

Hi guys I have additional changes but for 8.5.x, please verify it.

Malevi4’s picture

Status: Fixed » Needs review

Status: Needs review » Needs work

The last submitted patch, 88: drupal-coding-standards-2715485-88.patch, failed testing. View results

mfernea’s picture

Status: Needs work » Fixed

This issue is fixed.
@Malevi4: changes in your patch relate to the sniff fixed in #2719649: Fix 'Drupal.Commenting.InlineComment.SpacingBefore' coding standard.

Malevi4’s picture

Thanks, I will move it to #2719649: Fix 'Drupal.Commenting.InlineComment.SpacingBefore' coding standard.

Malevi4’s picture

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.