uncrustify: How do I set the maximum line length

1.5k Views Asked by At

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?

1

There are 1 best solutions below

2
On

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.