当前位置: 动力学知识库 > 问答 > 编程问答 >

C Code formater/beautifier

问题描述:

I need some commandline tool to format my C Code for Linux(Ubuntu).

It should:

Indent Code and Comments as I want(configuring with flags)

Remove/add spaces to operators(should be configurable for each operator separately)

If possible format inline-assembler(Intel not AT&T)

Add empty lines after functions and declaration blocks

Replace tabs with spaces

Astyle and GNU Indent have not enough options for my purposes

thanks for your help

网友答案:

Uncrustify is a highly configurable code beautifier.

网友答案:

Please try GNU indent. It may be useful to you.

网友答案:

Since this question is entirely based on opinions , I would also like to give one :

You are talking about Linux , why not try Emacs. You can have different formats for different codes of different languages and with auto indentation features. If you paste some unformatted/unindented code in it , you can select and press TAB to indent the whole code.

Besides , it also is very powerful.

分享给朋友:
您可能感兴趣的文章:
随机阅读: