xixiaofinland / sf.nvim

A Salesforce development Neovim plugin
MIT License
29 stars 7 forks source link

Proposal: Implement stylua formatting in project #239

Closed FedeAbella closed 1 month ago

FedeAbella commented 1 month ago

StyLua is one of the most common lua formatters I've seen around, and one commonly found in nvim lsp configs.

I propose we adopt stylua formatting guidelines within the project, so we can have uniform indentation, quotation, etc across the entire project. This makes it easier for new collaborators to jump in, especially if they already have stylua in their nvim config.

The change should be simple enough, by adding a .stylua.toml file in the root of the project with our desired defaults, then letting nvim format the files appropriately. I've noticed you prefer using 2 space indentation @xixiaofinland, and I think we can safely leave that by using

indent_width = 2
indent_type = "Spaces"

in the .stylua.toml file. We can also discuss what other defaults to use.

If this is fine by you, I can take on this and propose a reformatting soon.

FedeAbella commented 1 month ago

Of course, we could also use any other formatter. I think having a common format is more important than which formatter to use.

xixiaofinland commented 1 month ago

@FedeAbella definitely, this is a very good proposal! I do prefer 2 space indentation in most languages including apex, javascript, and Rust.

Just had a look at stylua, it seems straight forward and easy to use.

Feel free to craft the .stylua.toml and make a PR. ❤