Fix remaining VariableComment.MissingVar annotation

Created on 19 November 2017, over 7 years ago
Updated 20 March 2023, about 2 years ago

Problem/Motivation

See #2909372-14: [PP-1] Fix 'Drupal.Commenting.VariableComment.MissingVar' coding standard โ†’ for the reason why this child issue was created and ๐ŸŒฑ [meta] Fix 'Drupal.Commenting.VariableComment' coding standard Active for general instructions about working on Drupal.Commenting.VariableComment coding standard errors.

This started out fixing only arrays that have default values but changed to fixing all remaining problems discovered by the sniff.

Steps to reproduce

Proposed resolution

Fix all the remaining VariableComments so the sniff can be enabled. This is about 55 changes which keeps the patch a reasonable size for a coding standards issue.

When committed the parent can be closed, #2909372: [PP-1] Fix 'Drupal.Commenting.VariableComment.MissingVar' coding standard โ†’ .

Remaining tasks

Review
Commit

User interface changes

API changes

Data model changes

Release notes snippet

Drupal.Commenting.VariableComment.MissingVar has been enabled.

๐Ÿ› Bug report
Status

Needs work

Version

10.1 โœจ

Component
Otherย  โ†’

Last updated about 4 hours ago

Created by

๐Ÿ‡ณ๐Ÿ‡ดNorway zaporylie

Live updates comments and jobs are added and updated live.
  • Coding standards

    It involves compliance with, or the content of coding standards. Requires broad community agreement.

Sign in to follow issues

Merge Requests

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

  • ๐Ÿ‡ณ๐Ÿ‡ฟNew Zealand quietone

    Implementing sniffs are not bugs, they are tasks.

    The failing test is not related to these changes, I am retesting.

  • Pipeline finished with Canceled
    8 months ago
    Total: 67s
    #250419
  • Pipeline finished with Failed
    8 months ago
    #250420
  • Pipeline finished with Failed
    8 months ago
    #250460
  • Status changed to Needs review 8 months ago
  • ๐Ÿ‡ณ๐Ÿ‡ฟNew Zealand quietone

    Changing the scope to make the change set smaller and easier to review.

  • ๐Ÿ‡ณ๐Ÿ‡ฟNew Zealand quietone
  • Status changed to RTBC 8 months ago
  • ๐Ÿ‡บ๐Ÿ‡ธUnited States smustgrave

    Reviewed the updates and changes appear correct.

  • Status changed to Needs work 8 months ago
  • ๐Ÿ‡ฌ๐Ÿ‡งUnited Kingdom longwave UK

    MR has merge conflicts.

  • ๐Ÿ‡ณ๐Ÿ‡ฟNew Zealand quietone

    quietone โ†’ changed the visibility of the branch 2924782-missing-var-annotation to hidden.

  • Status changed to Needs review 8 months ago
  • ๐Ÿ‡ณ๐Ÿ‡ฟNew Zealand quietone

    Rebased

  • Status changed to RTBC 8 months ago
  • ๐Ÿ‡บ๐Ÿ‡ธUnited States smustgrave

    Rebase seems good.

  • ๐Ÿ‡ณ๐Ÿ‡ฟNew Zealand quietone

    Rebased and changed the instance in \Drupal\FunctionalTests\Update\UpdatePathTestBase to an {@inheritdoc}.

  • First commit to issue fork.
  • Pipeline finished with Failed
    7 months ago
    Total: 688s
    #276109
  • ๐Ÿ‡ฌ๐Ÿ‡งUnited Kingdom longwave UK

    MR has a merge conflict and a question about the change to phpcs.xml.dist.

    Also, the release note snippet in the IS seems wrong, as we are enabling that in the parent issue - not here.

  • ๐Ÿ‡ณ๐Ÿ‡ฟNew Zealand quietone

    Rebased and had to fix mistakes so setting to NR.

  • ๐Ÿ‡บ๐Ÿ‡ธUnited States smustgrave

    Rebase seems good.

  • ๐Ÿ‡ฌ๐Ÿ‡งUnited Kingdom alexpott ๐Ÿ‡ช๐Ÿ‡บ๐ŸŒ

    I think we should be changing phpcs.xml to enable the rule no? Also I think removing the @var when there is a default value is really odd.

  • Pipeline finished with Failed
    5 months ago
    Total: 398s
    #319267
  • Pipeline finished with Success
    5 months ago
    Total: 638s
    #319307
  • ๐Ÿ‡ณ๐Ÿ‡ฟNew Zealand quietone

    @alexpott, thanks for the review.

    Unfortunately, the scoping on this is unusual and the sniff can't be modified to cover this set of changes. However, I did enable the sniff for some file patterns. In the parent issue the remaining 50 errors in 32 files can be fixed and the sniff enable for all files.

  • Status changed to Needs work 5 months ago
  • The Needs Review Queue Bot โ†’ tested this issue. It no longer applies to Drupal core. Therefore, this issue status is now "Needs work".

    This does not mean that the patch necessarily needs to be re-rolled or the MR rebased. Read the Issue Summary, the issue tags and the latest discussion here to determine what needs to be done.

    Consult the Drupal Contributor Guide โ†’ to find step-by-step guides for working with issues.

  • ๐Ÿ‡ณ๐Ÿ‡ฟNew Zealand quietone

    A straightforward rebase so restoring RTBC

  • ๐Ÿ‡ฌ๐Ÿ‡งUnited Kingdom alexpott ๐Ÿ‡ช๐Ÿ‡บ๐ŸŒ

    This change confuses me because it's removing @var from stuff... also if I only apply the changes to the phpcs.xml.dist and run PHPCS the other error that's found is:

    > phpcs --standard=core/phpcs.xml.dist --parallel="$( (nproc || sysctl -n hw.logicalcpu || echo 4) 2>/dev/null)" -- 'core'
    
    FILE: /Volumes/dev/drupal/core/modules/block/tests/src/Kernel/NewDefaultThemeBlocksTest.php
    -------------------------------------------------------------------------------------------
    FOUND 1 ERROR AFFECTING 1 LINE
    -------------------------------------------------------------------------------------------
     37 | ERROR | Missing @var tag in member variable comment
    -------------------------------------------------------------------------------------------
    
    Time: 26.72 secs; Memory: 12MB
    

    So the rule changes are not covering the changes being made here.

  • Pipeline finished with Success
    5 months ago
    Total: 1230s
    #345614
  • ๐Ÿ‡บ๐Ÿ‡ธUnited States xjm
  • ๐Ÿ‡ณ๐Ÿ‡ฟNew Zealand quietone

    The 'Overview' in the MR does not reflect the actual changes and it quite confusing. There were also truly unexpected errors on my part that I can't quite figure out how they happened. So, I started over and it turns out that this can now enable the sniff as well.

    So, I am closing the parent as a duplicate, changing the title and moving credit.

  • Pipeline finished with Success
    4 months ago
    Total: 214s
    #347786
  • Pipeline finished with Success
    4 months ago
    Total: 187s
    #347791
  • ๐Ÿ‡ณ๐Ÿ‡ฑNetherlands daffie

    All the documentation changes look good to me.
    The remark of @alexpott has been addressed.
    For me it is RTBC.

  • ๐Ÿ‡ฆ๐Ÿ‡บAustralia larowlan ๐Ÿ‡ฆ๐Ÿ‡บ๐Ÿ.au GMT+10

    Couple of minor issues in the MR, also needs a reroll

    Thanks for working on this.

  • ๐Ÿ‡ฎ๐Ÿ‡ณIndia kulpratap2002

    kul.pratap โ†’ made their first commit to this issueโ€™s fork.

  • Pipeline finished with Failed
    4 months ago
    Total: 882s
    #374708
  • Pipeline finished with Failed
    4 months ago
    Total: 145s
    #374723
  • ๐Ÿ‡ณ๐Ÿ‡ฟNew Zealand quietone

    @kul.pratap, Welcome to Drupal! Thanks for working on this. I made a few comments in the MR. Also, This is failing the pre commit checks. It is good practice to Run core development checks โ†’ locally before submitting a change.

    There have been recent commits that are causing more errors. I don't think the sniff can be enabled here. This will have to go back to doing a subset of files. I'll look into that now.

  • ๐Ÿ‡ฎ๐Ÿ‡ณIndia kulpratap2002

    @quietone Thank you for the feedback. I will review the comments in the MR and address them.

  • ๐Ÿ‡ณ๐Ÿ‡ฟNew Zealand quietone

    @kul.pratap, thanks. I just added another change to exclude files in 'Plugin' directories. That should help here.

    Updating title for the new scope.

    I'll work on an issue for the changes in the 'Plugin' directories.

  • ๐Ÿ‡ฎ๐Ÿ‡ณIndia kulpratap2002

    @quieton Should I resolve the unresolved issues in the MR as mentioned by you?

  • ๐Ÿ‡ณ๐Ÿ‡ฟNew Zealand quietone

    @kul.pratap, Thanks for asking! The suggested changes to phpcs.xml.dist should exclude the files that have just started to cause violations from being checked by phpcs. Without those being checked that will bet this back on track to where only the feedback from larowlan and myself need to be resolved.

    The files that have just started to cause the violations are going to be fixed in the parent issue, along with enabling the sniff on all of core. I've already set that up and postponed that on this issue.

    I hope that all make sense.

  • Pipeline finished with Failed
    4 months ago
    Total: 91s
    #374876
  • ๐Ÿ‡ฎ๐Ÿ‡ณIndia kulpratap2002

    @quietone Please review.

  • ๐Ÿ‡บ๐Ÿ‡ธUnited States smustgrave

    Pipeline has errors. Would recommend verifying that everything passes before putting into review please.

  • Pipeline finished with Failed
    3 months ago
    Total: 94s
    #389596
  • ๐Ÿ‡ณ๐Ÿ‡ฟNew Zealand quietone

    @kul.pratap, thanks for reverting those changes.

    I was concerned that the number of files to change would make the MR here larger that our recommended size. So, I've updated phpcs.xml.dist to ignore Plugin files, which agrees with the title here. There are still about 25 files to edit.

  • Pipeline finished with Failed
    3 months ago
    Total: 847s
    #395024
  • Pipeline finished with Failed
    2 months ago
    Total: 114s
    #401177
  • ๐Ÿ‡ณ๐Ÿ‡ฟNew Zealand quietone

    More changes for recent commits.

  • ๐Ÿ‡บ๐Ÿ‡ธUnited States smustgrave

    Tried to resolve some threads but things got messy at some point. Left most open.

  • ๐Ÿ‡ณ๐Ÿ‡ฟNew Zealand quietone

    This is at least the second time I have had the gitlab MR UI disagree with the changes that are actually in the branch. It is very confusing.

    We need to agree to the change for core/tests/Drupal/FunctionalTests/Installer/InstallerExistingConfigTestBase.php.

  • The Needs Review Queue Bot โ†’ tested this issue. It no longer applies to Drupal core. Therefore, this issue status is now "Needs work".

    This does not mean that the patch necessarily needs to be re-rolled or the MR rebased. Read the Issue Summary, the issue tags and the latest discussion here to determine what needs to be done.

    Consult the Drupal Contributor Guide โ†’ to find step-by-step guides for working with issues.

  • ๐Ÿ‡ณ๐Ÿ‡ฟNew Zealand quietone

    I meant to re-scope this but I accidentally created a new issue to divide up the work for this sniff.

    I am closing as a duplicate an transferring credit to #2909372: Enable 'Drupal.Commenting.VariableComment.MissingVar' coding standard โ†’

  • Pipeline finished with Failed
    about 1 month ago
    Total: 1210s
    #429879
  • Pipeline finished with Canceled
    about 1 month ago
    Total: 218s
    #429958
  • Pipeline finished with Success
    about 1 month ago
    Total: 1512s
    #429961
  • Pipeline finished with Canceled
    about 1 month ago
    Total: 928s
    #430011
  • Pipeline finished with Canceled
    about 1 month ago
    Total: 573s
    #430016
  • Pipeline finished with Success
    about 1 month ago
    Total: 1269s
    #430023
  • Pipeline finished with Canceled
    about 1 month ago
    #430058
  • Pipeline finished with Canceled
    about 1 month ago
    #430060
  • Pipeline finished with Canceled
    about 1 month ago
    Total: 324s
    #430061
  • Pipeline finished with Failed
    about 1 month ago
    Total: 1248s
    #430064
  • Pipeline finished with Failed
    about 1 month ago
    Total: 1680s
    #430087
  • Pipeline finished with Failed
    about 1 month ago
    Total: 1508s
    #430107
  • Pipeline finished with Failed
    about 1 month ago
    Total: 1471s
    #430485
  • Pipeline finished with Failed
    about 1 month ago
    Total: 1243s
    #430513
  • Pipeline finished with Success
    about 1 month ago
    Total: 1343s
    #430553
  • Pipeline finished with Failed
    about 1 month ago
    Total: 1250s
    #430573
  • Pipeline finished with Failed
    about 1 month ago
    Total: 1102s
    #430600
  • Pipeline finished with Success
    about 1 month ago
    Total: 1260s
    #430616
  • Pipeline finished with Canceled
    about 1 month ago
    Total: 400s
    #430659
  • Pipeline finished with Success
    about 1 month ago
    Total: 1192s
    #430665
  • Pipeline finished with Success
    about 1 month ago
    Total: 1220s
    #430719
  • Pipeline finished with Skipped
    about 1 month ago
    #430779
  • Pipeline finished with Failed
    6 days ago
    Total: 780s
    #461158
Production build 0.71.5 2024