Add error_on_line_overflow option
Makes it configurable whether to error if unable to get all lines within the max_width.
This commit is contained in:
parent
4f939ddf0c
commit
f6ccbd71c3
2 changed files with 2 additions and 1 deletions
|
|
@ -333,6 +333,7 @@ create_config! {
|
|||
via the --file-lines option";
|
||||
max_width: usize, 100, "Maximum width of each line";
|
||||
ideal_width: usize, 80, "Ideal width of each line";
|
||||
error_on_line_overflow: bool, true, "Error if unable to get all lines within max_width";
|
||||
tab_spaces: usize, 4, "Number of spaces per tab";
|
||||
fn_call_width: usize, 60,
|
||||
"Maximum width of the args of a function call before falling back to vertical formatting";
|
||||
|
|
|
|||
|
|
@ -399,7 +399,7 @@ fn format_lines(text: &mut StringBuffer, name: &str, config: &Config, report: &m
|
|||
line_len -= b - lw;
|
||||
}
|
||||
// Check for any line width errors we couldn't correct.
|
||||
if line_len > config.max_width {
|
||||
if config.error_on_line_overflow && line_len > config.max_width {
|
||||
errors.push(FormattingError {
|
||||
line: cur_line,
|
||||
kind: ErrorKind::LineOverflow(line_len, config.max_width),
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue