wrcad / xictools

XicTools: Xic graphical editor, WRspice circuit simulator, and accessories. for electronic design.
http://wrcad.com
138 stars 40 forks source link

clang-format #19

Open risc26z opened 5 months ago

risc26z commented 5 months ago

Please could we adopt clang-format in the project? If you're unfamiliar with it, it automatically applies some code formatting rules, specified in a file named '.clang-format' in the project root. Lots of editors have built-in support. I'm attaching a rules file that I use in one of my own projects as an example (it'll need to be renamed).

Readability helps a lot with working on a large codebase, and consistency in formatting really makes a difference. I have a little shell script with a 'find' recipe to run it against all my source files (I also invoke dos2unix at the same time).

Advantages:

Disadvantages:

clang-format.txt

wrcad commented 5 months ago

Thank you, I'll look into this when I get time.