Open bytemain opened 6 months ago
unified code style can reduce the cost of maintaining and reviewing code, and can find potential risks
Agree! But how do we do that?
just a idea, we ship a new binary called vfox-dev
(or what ever).
vfox-dev lint
vfox-dev build
https://github.com/CppCXY/EmmyLuaCodeStyle
there are some code styles linters, but most of them need user clone them and build them on machine.
or we can use dprint, it is a pluggable and configurable code formatting platform written in rust.
it has a lua plugin: https://github.com/RubixDev/dprint-plugin-stylua
I found that it support install by asdf, ahahahah
I found that it support install by asdf, ahahahah
If we decide to use this, we can also implement a plug-in of our own. After taking a look, it is very easy. 😄
just a idea, we ship a new binary called
vfox-dev
(or what ever).
I don't think we need to spend too much time on this, dprint
is a good choice.
ok, I will take a look on install dprint by vfox
we can also use stylua
and add its configuration to the root of the project:
stylua.toml
column_width = 120
line_endings = "Unix"
indent_type = "Tabs"
indent_width = 4
quote_style = "AutoPreferDouble"
call_parentheses = "Always"
collapse_simple_statement = "Never"
[sort_requires]
enabled = false
yes, the dprint plugin we mentioned above in using stylua
to format lua files.
and dprint can also format markdown and json files.
@bytemain @axdank Hi guys, I think I've finished working on the templates for the plugin repository, and I think this issue can be resolved in the template repository.
For example, we could put dprint
in the plugin repository, tell the user how to use it, or automate do this work by Github Action.
unified code style can reduce the cost of maintaining and reviewing code, and can find potential risks