[cosmetic] is it a good idea to add autoformatting for Espruino source code? #7820
Replies: 2 comments 1 reply
-
People have asked this before, but I feel like we've done ok in the past 10+ years and we haven't had huge problems with code style being different. The reality is very few people contribute code back, and those that do seem to be fine with copying the way things are now. We also include other code (like ST/Nordic APIs) that has its own style that we'd have to try and manually exclude. It feels like you're using indent/tab widths of 4 when Espruino uses 2 (see https://github.com/espruino/Espruino/blob/master/CONTRIBUTING.md#coding-style) and maybe some other things. Could it be you're finding the code isn't formatted properly because you're expecting it to be different to what it actually is? |
Beta Was this translation helpful? Give feedback.
-
Just tested Ruff linter for Python, and looks good:
installhttps://docs.astral.sh/ruff/installation/
|
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
I personally use code autoformatting in all projects:
clang-format
for C/C++ codeprettier
for JS/JSONautopep8
for Python scriptsAutoformatting makes code a bit cleaner and easier to read, so maybe it will be good idea to integrate it into the Espruino build process?
.clang-format
.prettierrc
`.vscode/settings.json
Beta Was this translation helpful? Give feedback.
All reactions