We have a STYLE.md guide for .asm formatting (tab indentation, lowercase instructions, etc), although there isn't an automated tool for it (yet! "rgbfmt" has been proposed before).
We also have many C tools, which could benefit from easy consistent formatting. Our current formatting includes:
- C11 standard
- Tab indentation
- "Java-style" brace/whitespace styling
- Braces required around blocks
- Variable declarations at first use (not all grouped at the function start)
cases indented the same level as their switch
- Explicit
// fallthrough comments for cases
- et cetera; we're pretty good about keeping consistent rules, so a .clang-format file could be tweaked to match our current conventions as closely as possible
- No strict line length limit yet, but only 29 lines out of more than 1,500 are above 100 characters, 11 are above 120, 6 are above 130; since many long lines are from long
#define USAGE_OPTS strings, and function signatures with many args, I think 100 would be appropriate when a tool like clang-format can enforce it
We have a STYLE.md guide for .asm formatting (tab indentation, lowercase instructions, etc), although there isn't an automated tool for it (yet! "rgbfmt" has been proposed before).
We also have many C tools, which could benefit from easy consistent formatting. Our current formatting includes:
cases indented the same level as theirswitch// fallthroughcomments forcases#define USAGE_OPTSstrings, and function signatures with many args, I think 100 would be appropriate when a tool like clang-format can enforce it