-
Notifications
You must be signed in to change notification settings - Fork 70
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
chore(vscode): codestyle check #3485
base: main
Are you sure you want to change the base?
Conversation
Since the current CI run will only run luacheck, which seems to only give format warnings when it comes to line length and whitespace, is it possible to extend the CI config to also check this configuration? |
Would the mw.html.create('div')
:css() |
In the future, I want to look into it. Currently there's 4k style issues, so will take a bit to clean it up. Additionally thinking about running the formatter as a pre-commit hook |
Yup |
Obviously, open for discussion on things! |
An alternative would be using https://github.com/JohnnyMorganz/StyLua instead Has prebuilt support for VSCode, Github Actions & https://pre-commit.com/ |
about the continuation indents, what about stuff like if
someverlong conditons someverlong conditons someverlong conditons
someverlong conditons someverlong conditons someverlong conditons
then
code
end would that also get double tab now? |
I'd prefer to not install yet another VS Code extension if possible, and if i am not mistaken that is not a complete replacement of sumneko/lua-ls. |
agree with mbergen |
i personally like 8 as tab width but am fine with 4 too |
Shouldn't your personal editor config on tab width change the display to 8? I mean that's one of the selling points of tabs over spaces, so that everyone can have the indentation he likes |
well yeah but alignements might look different between contributors due to it and hence sometimes spacing might look lets call it unusual :P |
Summary
Activate code style checking directly in VSCode. Currently setting default warning level to
information
as there's a ton of them.Style can be formatted by
alt + shift + f
by default, for current document. Or by right clicking and selectingformat document
.Biggest difference towards what we use a lot of is the setting of
continuation_indent = 8
. This will be double indent for wrapped/continuous line.That would change
into
There are some minor issues, specifically
:tag()
chaining, as it doesn't understand that it should be another level deeper with it. We'll look into it have to solve it.