Prevent @file annotations from creeping back into the codebase

Created on 10 November 2023, over 1 year ago
Updated 31 May 2024, 10 months ago

Problem/Motivation

πŸ“Œ Remove @file annotation from test classes Needs review removed @file annotations that are no longer required by our coding standards and get in the way of applying rector rules.

We can prevent these from coming back accidentally via PHPCS.

Steps to reproduce

Proposed resolution

Use SlevomatCodingStandard.Commenting.ForbiddenAnnotations to prevent @file annotations similar to how we prevent @inheritdoc without curly braces.

Remaining tasks

Postponed on πŸ“Œ @file doc blocks for test classes with an additional class in the file Active

User interface changes

API changes

Data model changes

Release notes snippet

πŸ“Œ Task
Status

Postponed

Version

11.0 πŸ”₯

Component
BaseΒ  β†’

Last updated about 8 hours ago

Created by

πŸ‡¬πŸ‡§United Kingdom longwave UK

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

Comments & Activities

  • Issue created by @longwave
  • πŸ‡¬πŸ‡§United Kingdom longwave UK

    We can't apply this to all files, we only want it to apply to something like */src/*.php but not sure how to integrate this with the existing sniffs for @inheritdoc, though maybe we can limit those as well.

  • Status changed to Postponed over 1 year ago
  • πŸ‡³πŸ‡ΏNew Zealand quietone

    This is covered by the rule <rule ref="Drupal.Commenting.FileComment"/> which is enabled in core. The files that are changed in the parent issue are missed because they have an additional class in the file. A complete explanation is in the Coding Standards issue filed to address this, πŸ“Œ @file doc blocks for test classes with an additional class in the file Active .

    I think we need to postpone this until that is resolved and eventually Coder works for files with multiple classes.

  • πŸ‡³πŸ‡ΏNew Zealand quietone
Production build 0.71.5 2024