prettier / plugin-php

Prettier PHP Plugin
https://loilo.github.io/prettier-php-playground/
MIT License
1.74k stars 128 forks source link

Symfony #[Route] Formatting Bug #2360

Open TomoyaHamasaki opened 5 months ago

TomoyaHamasaki commented 5 months ago

The formatting of #[Route] lines are broken, I think. It tends to spread out over multiple lines when it could neatly fit into just one.

Input

#[Route('route/path', name: 'very_very_very_very_very_very_long_route_name', methods: ['GET'])]

Output

#[
    Route('
        'route/path',
        name: 'very_very_very_very_very_very_long_route_name',
        methods: ['GET']
    )
]
cseufert commented 4 months ago

Following PER CS 2.0 we should never have a line break after #[ and before the closing ]