Problem/Motivation
The sniff Drupal.Commenting.VariableComment.Missing is reporting errors on some variables that do have a comment. For example, this from core/modules/node/src/Plugin/views/row/Rss.php.
/**
* The base field for this row plugin.
*/
// phpcs:ignore Drupal.NamingConventions.ValidVariableName.LowerCamelName
public string $base_field = 'nid';Steps to reproduce
Proposed resolution
Add Drupal.Commenting.VariableComment.Missing to the existing phpcs line.
The sniff can't be enabled for this set of changes. These are false positives that needs to be handled individually and are not in a single directory path. Once this issue is committed it should be possible to enable the sniff for the relevant file paths in the sibling issues.
Remaining tasks
Make a follow up to remove the ignore changes when #3477601: False positives with Drupal.Commenting.VariableComment.Missing is fixed.
User interface changes
Introduced terminology
API changes
Data model changes
Release notes snippet
Issue fork drupal-3477614
Show commands
Start within a Git clone of the project using the version control instructions.
Or, if you do not have SSH keys set up on git.drupalcode.org:
- 3477614-ignore-variablecomment.missing-as
changes, plain diff MR !9683
Comments
Comment #3
quietone commentedComment #4
smustgrave commentedThink the issue in the summary is wrong. That's pointing to an unsupported contrib module.
Comment #5
quietone commentedComment #6
smustgrave commentedOpened #3478812: Remove phpcs:ignore VariableComment.Missing
Comment #7
larowlanCouple of questions.
Should we also be enabling the rule in phpcs.xml at the same time?
Comment #8
quietone commentedThe rule can't be enabled on this set of files as they are not in a single filepath. Once this issue is committed it should be possible to start enabling the sniff for sets of files in the sibling issues. I updated the IS to clarify this.
Comment #9
smustgrave commentedBelieve feedback for this one has been addressed
Comment #11
larowlanCommitted to 11.x - thanks!
Comment #14
larowlanI backported this to 11.1.x