this post was submitted on 13 Jul 2023
4 points (100.0% liked)

C++

1732 readers
13 users here now

The center for all discussion and news regarding C++.

Rules

founded 2 years ago
MODERATORS
top 6 comments
sorted by: hot top controversial new old
[–] [email protected] 8 points 2 years ago (3 children)

I would recommend clang-tidy. You can have it running if you use the clangd Language Server.

[–] [email protected] 3 points 2 years ago (1 children)

+1 for clang-tidy because clang is good. There is also scan-build in clang but it's a PITA to use.

And for OP, you can also install sonarlint on some editors/IDE but I don't know if the scanned code is sent remotely or not.

[–] [email protected] 3 points 2 years ago

@glad_cat @jormaig

Here's also a good resource for linters and formatters, sorted by languages:

https://github.com/caramelomartins/awesome-linters

[–] nitefox 1 points 2 years ago

I will go with this, thank you!

[–] AlmightySnoo 1 points 2 years ago

I wish people just used clang-tidy instead of pushing all the crap that's out there, like for instance PC-Lint Plus. At work the head of IT makes our work a living hell by insisting the CI runs a shit beta version of PC-Lint Plus which lacks full C++17 support and we have to reinvent stuff like variants and deprive ourselves of many C++ features because of one single linting tool.

[–] [email protected] 2 points 2 years ago

I use cppcheck.