简体   繁体   中英

Uncrustify: Trim linebreaks before braces

What is the right config for uncrustify so that it removes empty lines before curly braces so that:

        }

    }
    else
    {
        // foo
    }
    [bar tend];

}

becomes:

        }
    }
    else
    {
        // foo
    }
    [bar tend];
}

I scourged the docs but couldn't find the right setting, maybe it has an unusual name.

Found it. The following will take care of spurious blank lines.

eat_blanks_after_open_brace   = TRUE
eat_blanks_before_close_brace = TRUE
nl_max = 2

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM