Companion to GitLab issue #3313835 (reported by alex.skrypnyk).
Problem
src/Services/AddCommentService.php (line ~41) wraps its notice as:
// TODO: Drupal Rector Notice: Please delete the following comment after you've made any necessary changes.
Drupal coder's Drupal.Commenting.TodoComment standard expects // @todo ..., so rector's own generated output fails PHPCS on the patched code. It should emit // @todo Drupal Rector Notice: ....
Introduced in https://github.com/palantirnet/drupal-rector/pull/100/files (R44).
Scope of the fix
- One line in
AddCommentService.php (// TODO: → // @todo).
- ~58 fixture files under
tests//fixtures/ contain the // TODO: Drupal Rector Notice string in their expected output and would need the same mechanical update.
Also investigate
Before fixing, audit whether AddCommentService (the comment-adding trait/service) is still actually used by current rectors, or whether it's only wired into legacy (D8/D9) rules. If the only consumers are outdated rectors we're no longer maintaining, the right move may be to remove/retire it rather than update 58 fixtures. Determine the live consumers first, then decide: fix the wrapper vs. retire the service.
Companion to GitLab issue #3313835 (reported by alex.skrypnyk).
Problem
src/Services/AddCommentService.php(line ~41) wraps its notice as:// TODO: Drupal Rector Notice: Please delete the following comment after you've made any necessary changes.Drupal coder's
Drupal.Commenting.TodoCommentstandard expects// @todo ..., so rector's own generated output fails PHPCS on the patched code. It should emit// @todo Drupal Rector Notice: ....Introduced in https://github.com/palantirnet/drupal-rector/pull/100/files (R44).
Scope of the fix
AddCommentService.php(// TODO:→// @todo).tests//fixtures/contain the// TODO: Drupal Rector Noticestring in their expected output and would need the same mechanical update.Also investigate
Before fixing, audit whether
AddCommentService(the comment-adding trait/service) is still actually used by current rectors, or whether it's only wired into legacy (D8/D9) rules. If the only consumers are outdated rectors we're no longer maintaining, the right move may be to remove/retire it rather than update 58 fixtures. Determine the live consumers first, then decide: fix the wrapper vs. retire the service.