c-code-style
c-code-style copied to clipboard
cfg AStyle formatter does not fix all the conventions
I tried using the astyle-code-format.cfg file with style but it almost only fixes indents and braces. I like the rules you described for variable and function naming but I couldn't find a way to format my C files according to that. There is no such option in AStyle. So even if I use your cfg file with AStyle, there is no difference between using yours or a predefined XML file on Eclipse (like original K&R etc.)
Original K&R + adding tabs to spaces is the way to go with my rules written here.
Do you mean the Original K&R has the same naming rules as you described like having all lowercase letters for example? If yes, then there is no option in AStyle or Eclipse's Formatter to re-format them I guess? If yes, do you have any suggestions on that? We have a couple of libraries provided by different manufacturers and we want to use the same formatting on them.
K&R does not have naming rules and it won't change variable name or declaration order as per my style. So it means that you cannot 100% automate your code with AStyle, some things would need to be properly written manually.
the style is a convention for code maintaining, consistency is paramount. and if this convention harm your code maintaining then relinquish it.
邮件已收到,我会尽快回复的!
It is not advised to use astyle anymore. Clang-format is preferred way.