Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
On #2729083: @encode becomes @endcode, some instances of misspelled @endcode tags are being fixed.
It would be good if we had a sniffer that detected unknown tags in documentation. We could whitelist the tags that are listed on https://www.drupal.org/node/1354 and if any others were detected in doc blocks, flag an error.
So for instance if someone used @returns instead of @return, or @encode instead of @endcode, their patch would fail the sniffer test, and we'd avoid having unknown tags in the docs.
Comments
Comment #2
borisson_It might be possible to create such a whitelist for core, but since contrib/custom code can add it's own plugin types, I don't see how it would be possible to maintain such a list.
It's easier to catch @encode / @returns specifically and warn about those but I don't see a lot of value in that.
Comment #3
jhodgdonIt should be possible to use a regular expression for plugin annotations. These are special because they look like:
or
They must have () so I think we can detect them with a regular expression. That is what the API module does.