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

前端 未结 4 1908
后悔当初
后悔当初 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:29

    There are several programs that can do formatting for you automatically on save (such as Eclipse). You can have format settings that everyone can use ensuring the same formatting.

    It is also possible to automatically apply such formatting when code is committed. When you use SVN, the system to do this is called svn hooks. This basically starts a program to process (or check and deny) the formatting when a commit happens.

    This site explains how you can make your own. But also ones already exist to do this.

提交回复
热议问题