- Issue created by @pfrenssen
- Status changed to Closed: works as designed
5 months ago 2:01pm 19 July 2024
Annotations are not limited to 80 characters. In practice we are supporting annotations already quite well thanks to earlier work done in #2530920: Over-aggressive line length chokes on annotations → , but there is a common case that is not covered: translatable strings.
As a showcase, the example listed in the actual coding standard for annotations currently doesn't pass tests (ref. Coding standard for plugin discovery annotations → .
We throw a Line exceeds 80 characters
error on the line with the description:
/**
* @Plugin(
* id = "aggregator",
* title = @Translation("Default fetcher"),
* description = @Translation("Downloads data from a URL using Drupal's HTTP request handler."),
* )
*/
class DefaultFetcher implements FetcherInterface {
Let's use a regex with a narrow scope to minimize false positives. I would propose to exclude lines that contain = @Translation(
since this will be almost exclusively found inside annotations.
Closed: works as designed
8.3
Coder Sniffer