Conversation
|
I’m confused I ran the exact same command on my laptop and everything passes; did I miss something? |
|
Hello, @apollisa The test fails because the AST changed, run |
|
Oh indeed with Should Prettier keep the AST unchanged? Because here if we want to stick with the PSR rules, we must split attributes that span multiple lines: #[
IA("interface"),
\\Looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong\\Namespace\\WithStuff\\IB
]becomes #[IA("interface")]
#[\\Looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong\\Namespace\\WithStuff\\IB] |
|
I'm not sure if this will be accepted, but if it's expected to produce different AST, you'll need change the old shape to new shape in https://github.com/prettier/plugin-php/blob/main/src/clean.mjs |
|
Well I’m sorry I can’t seem to make it to work 🤔 It would seem that the |
|
Looking at how if (node.kind === 'arrowfunc' || node.kind === 'parameter' /* || other kinds */) {
// Update newObj.attrGroups
}
|
This partially fixes #2360, in the sense that formatting now matches PSR guidelines. It will still split across multiple lines if need be though.