Are there any lint tools for C and C++ that check formatting?

前端 未结 4 1916
后悔当初
后悔当初 2021-02-05 15:05

I have a codebase that is touched by many people. While most people make an effort to keep the code nicely formatted (e.g. consistent indentation and use of braces), some don\'

4条回答
  •  逝去的感伤
    2021-02-05 15:27

    The Linux kernel uses a tool that does exactly this - it's called checkpatch. You'd have to modify it to check your coding standards rather than theirs, but it could be a good basis to work from. (It is also designed for C code rather than C++).

提交回复
热议问题