romgrk / barbar.nvim

The neovim tabline plugin.
2.2k stars 81 forks source link

Formatting rules #430

Closed romgrk closed 1 year ago

romgrk commented 1 year ago

@Iron-E hi, sorry to push this but I like my formatting a certain way, and I'm going to abuse my power here:

I find these more readable :) If we find an autoformatter that we can configure to lint stuff for us we can enable it.

Iron-E commented 1 year ago

Got it.

I was doing foo'bar' because that's how the project had been doing requires when I started contributing— should I wrap those in parens too?

For autoformatter, stylua or lua_ls might be a ble to do it.

romgrk commented 1 year ago

I was doing foo'bar' because that's how the project had been doing requires when I started contributing— should I wrap those in parens too?

Oh yeah I might have been inconsistent :|

No need to reformat code now, but just for new code, and we can reformat in one go if we set up a linter.

Iron-E commented 1 year ago

Apparently the lua language server integrates with editorconfig. We can add the options they list to the one in our repo

Iron-E commented 1 year ago

I added an EmmyLua configuration. If it doesn't format how you prefer, feel free to edit it! I took a look at the code in the project as it is and made my best guesses as to what the config should be.

In a followup PR (after pinned tabs preferably, to prevent more conflicts) we can format all of the files 🙂

Iron-E commented 1 year ago

Not all of the options in EmmyLua seem to apply. I have reported the issue upstream. Re-opening for now until it's solved.

Iron-E commented 1 year ago

I believe I've found the issue. Sometimes a lua/.luarc.json file gets created and that interferes with the editorconfig loading.