Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Generic/DocComment: bug fix - don't remove ignore annotations when fixing #3893

Conversation

jrfnl
Copy link
Contributor

@jrfnl jrfnl commented Sep 24, 2023

Description

The code sample included in the tests would previously result in an "There must be a single blank line after a tag group" error, even though there is a blank line after the @codeCoverageIgnore tag.

The auto-fixer would subsequently fix this by removing the @phpcs:disable comment + the blank line after it.

Fixed now.

Includes test.

Suggested changelog entry

  • Generic/DocComment: the SpacingAfterTagGroup fixer could accidentally remove ignore annotations.

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)
    • This change is only breaking for integrators, not for external standards or end-users.
  • Documentation improvement

…xing

The code sample included in the tests would previously result in an "There must be a single blank line after a tag group" error, even though there _is_ a blank line after the `@codeCoverageIgnore` tag.

The auto-fixer would subsequently fix this by removing the `@phpcs:disable` comment + the blank line after it.

Fixed now.

Includes test.
jrfnl added a commit to Yoast/whip that referenced this pull request Sep 26, 2023
Align parameter descriptions in docblocks and other minor formatting fixes.

Note: there is one more to fix, but this is waiting on a [bug fix in PHPCS](squizlabs/PHP_CodeSniffer#3893) (bug discovered when making this change).
@jrfnl jrfnl added this to the 3.8.0 milestone Oct 25, 2023
@jrfnl
Copy link
Contributor Author

jrfnl commented Dec 2, 2023

Closing as replaced by PHPCSStandards/PHP_CodeSniffer#91

@jrfnl jrfnl closed this Dec 2, 2023
@jrfnl jrfnl deleted the feature/generic-doccomment-fixer-removes-ignore-annotations branch December 2, 2023 02:36
@jrfnl
Copy link
Contributor Author

jrfnl commented Dec 8, 2023

FYI: this fix is included in today's PHP_CodeSniffer 3.8.0 release.

As per #3932, development on PHP_CodeSniffer will continue in the PHPCSStandards/PHP_CodeSniffer repository. If you want to stay informed, you may want to start "watching" that repo (or watching releases from that repo).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants