StyLua icon indicating copy to clipboard operation
StyLua copied to clipboard

Restricting call_parentheses = "NoSingleString" to require statements

Open r3ps4J opened this issue 5 months ago • 1 comments

Hey there! I've set up my .stylua.toml file with call_parentheses = "NoSingleString" as I like to have my require statements not being wrapped in parenthesis. However I do also have some methods that just accept a single string, for which the parentheses also get removed now. Is there a way to restrict this to just require statements? If not, I want to suggest adding this if that's possible.

r3ps4J avatar Jul 26 '25 13:07 r3ps4J

Unfortunately there is no way to do this right now, and I think it might be a bit too specific of an option to restrict to specifically requires.

You can use call_parentheses = "Input" to allow stylua to preserve parentheses (or lack of them) based on your original input source. However, this means you will lose out in enforcing consistency

JohnnyMorganz avatar Aug 10 '25 12:08 JohnnyMorganz