-
Notifications
You must be signed in to change notification settings - Fork 11
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
Unified code style across BlocksDS-maintained projects #168
Comments
I've spent a few hours with
Artistic Style:
In short... for now, let's not do this. I may spend a bit of time writing a document with some broad code style rules, and leave the rest to the discretion of the developer. |
That reminds me of a little story from years ago when #3dsdev on EFNet was still active. Someone opened an issue regarding clang-format to add single line if(). One of the devs responded how the code styles they offer are superior and the issue got closed. So yeah, don't rely on these tools too much. It's time consuming but formatting by hand gives the best results. |
Well, it looks like libnds is probably an exception. DSWiFi has taken quite a bit of work to manually change a few parts that caused clang-format to freak out. However, I have created a Same for libteak: blocksds/libteak@eeb96d7 |
This is tangentially related to this issue, but I think it could help code quality & style to keep a unified set of warnings across BlocksDS. It seems like each Makefile has it's own set of enabled and disabled warnings--I figure there probably shouldn't be any disabled warnings. |
There is no point in enabling any disabled warning if the occurrences of the warning aren't fixed, it would only add noise to the build. I've fixed lots of warnings and silenced the rest until they are fixed. Most of the projects are very old, and compilers didn't have as many warnings as today (and most people didn't bother enabling them anyway). |
I think -Wall -Wextra should be on by default everywhere. It enables many useful warnings. That plus maybe some more if needed. |
That's what we currently have, but we disable individual warnings in different repositories if they have instances of that warning that haven't been fixed. In most cases, I didn't fix them because I couldn't test the result properly, so I decided to not risk it. |
Oh, and the idea of disabling warnings is that if there are 10 warnings and you add one while doing some change, you won't notice it. If there are zero warnings, you will. |
clang-format
exists, let's make use of it.I have no strong opinions here, other than that:
clang-format
provides LLVM, Google, Chromium, Mozilla, WebKit, Microsoft), with some changes of our own,// clang-format off
may need to be used judiciously in areas which define registers and other such constants, as we may end up relying on unique formatting there to make it more readable for a human.The text was updated successfully, but these errors were encountered: