uncrustify: How do I set the maximum line length

After running uncrustify I want no line to be longer than, say, 80 characters. How do I set the maximum length of a line in the uncrustify config file?

Answers

Add a section like this to your config file. It does not guarantee to get all lines below the specified width.

#
# Line Splitting options
#

code_width            80            
# Unsigned Number
# Try to limit code width to N number of columns

ls_for_split_full     True  
# { False, True }
# Whether to fully split long 'for' statements at semi-colons.

ls_func_split_full    True
# { False, True }
# Whether to fully split long function protos/calls at commas.

ls_code_width         True
# { False, True }
# Whether to split lines as close to code_width as possible and ignore some groupings.
Posted on by ColonelFazackerley

Relevant tags