style: Add some basic configs#1923
Conversation
|
Also, I normally build with clang, but I set the default to gcc because clang emits a huge number of warnings: |
c210065 to
e3418b3
Compare
|
Whoops, I keep forgetting to add that commit description 😅 |
|
I'm not using clang, and I'm not familiar with it, so I'll assume this is like any other linter. If this only has warnings that actually prevent bugs, then go for it. |
|
@notbabaisyou ping |
Yep, clang-tidy is a linter/static analysis tool and has plenty of options for whether you'd prefer it to enforce a style or just look for bugs like undefined behavior, division by zero, null pointer deref, etc. It can also be bypassed with a // NOLINT comment. This would hopefully be a start to getting it integrated in a GitHub actions workflow like some other C and C++ projects use. As for the other files, editorconfig is simply a linter config and the clangd language server is the plumbing to bring warnings, errors, and code completion into VSCode, vim, or your other IDE of choice. For example, there are some "bugprone" warnings emitted in I can go ahead and convert this PR to draft though, there are probably some options to discuss and pare down on the configs to not be overbearing at first. |
Signed-off-by: John Studnicka <contact@zentec.dev>
Signed-off-by: John Studnicka <contact@zentec.dev>
Signed-off-by: John Studnicka <contact@zentec.dev>
Signed-off-by: John Studnicka <contact@zentec.dev>
e3418b3 to
05af825
Compare
|
Alright, I've tried to narrow clang-tidy down to bugs only and not go crazy on style. I also added a shell script that can call clang-tidy on a file or directory and print the number of warnings emitted. |

Added some simple .clang-tidy and .editorconfig files per this discussion - I believe this 4 spaces indentation would be a good starting point and match how most files are already formatted.