-
Notifications
You must be signed in to change notification settings - Fork 107
feat: add luaformatter formatter #54
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
The shiftwidth change should be a separate PR. Also looks like your vroom tests need to be fixed; they're failing in Travis CI. Besides that, LGTM. |
do you have any idea why lines are not matching in the test? |
@actionless Looks like it's just typos in the vroom. I see the same when running locally. I think you wanted |
braces. | ||
|
||
|
||
Shitftwidth will be used for indentation: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Unfortunate typo here.
i will commit fixes later today, thanks for finding the problems but i also have another question -- how it would be better to handle shiftwidth in clang formatter -- i am thinking about changing default formatting style[1] to [1] https://github.com/google/vim-codefmt/blob/master/instant/flags.vim#L63 |
My naive preference would be to The reason is that a lot of casual vim users don't configure shiftwidth, textwidth, etc. properly but will still expect codefmt to not cause formatting "regressions", like formatting based on their broken settings instead of custom project configuration. OTOH, if you have the editor configured with different settings from your formatters, you're going to have a bad time… It would be nice to just make vim's settings canonical and maybe warn for discrepancies. Side note: http://editorconfig.org/ looks interesting and I'm wondering if we can consolidate some configuration with that somehow. |
(For a) above, see #27) |
i think it should be some separate plugin which will set vim shiftwidth and other params based on config file and codefmt plugin should use those params from vim itself, ie don't depend on any third-party plugin or config file |
I wasn't suggesting an explicit plugin dependency, only that if https://github.com/editorconfig/editorconfig-vim is installed we should cooperate w/ it and avoid any conflicts, and possibly recommend editorconfig on our end to get sane default configuration. It may be as simple as inheriting vim's settings (#27) without needing to know how those were configured, but it's possible we'd also want to treat them as higher precedence if they came from editorconfig since editorconfig users are less likely to have config they don't expect/understand. |
then i will rebase this one after #27 will be implemented but i still can't understand what is the problem to use vim's |
I'm going to close this commit since been outstanding for a long time. It appears to me that the problem was that the the PR tried to do too much: Add a lua formatter (good), change sw (seems reasonable), but they should be in separate PRs. |
I don't see any reason you would block the luaformatter implementation on the shiftwidth change. Why not just remove that part of the change and follow up in #27, and here fix up the tests and get it submitted?
Commenting in #27 about that. You are correct that shiftwidth would come from editorconfig for users that have it installed and configured. My problem is that for everyone else, shiftwidth adds a new way for users to accidentally get formatting wrong. |
No description provided.