[epiphany] Update uncrustify configuration file and replace source on the fly
- From: Jan-Michael Brummer <jbrummer src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [epiphany] Update uncrustify configuration file and replace source on the fly
- Date: Sat, 6 Jul 2019 08:51:46 +0000 (UTC)
commit ea126af005e863d8907dd89866c853fc72e516a5
Author: Jan-Michael Brummer <jan brummer tabos org>
Date: Fri Jul 5 20:42:32 2019 +0200
Update uncrustify configuration file and replace source on the fly
data/kr-gnome-indent.cfg | 119 -----------------------------------------------
data/run-uncrustify | 2 +-
data/uncrustify.cfg | 107 ++++++++++++++++++++++++++++++++++++++++++
3 files changed, 108 insertions(+), 120 deletions(-)
---
diff --git a/data/run-uncrustify b/data/run-uncrustify
index c4105f1e6..c145183be 100755
--- a/data/run-uncrustify
+++ b/data/run-uncrustify
@@ -21,7 +21,7 @@ do
# Aligning prototypes is not working yet, so avoid headers
for FILE in $(find "$DIR" -name "*.c" ! -path "*/contrib/*")
do
- "$UNCRUSTIFY" -c "$SOURCE_ROOT/data/kr-gnome-indent.cfg" --no-backup "$FILE"
+ "$UNCRUSTIFY" -c "$SOURCE_ROOT/data/uncrustify.cfg" --replace --no-backup "$FILE"
"$LINEUP_PARAMETERS" "$FILE" > "$FILE.temp" && mv "$FILE.temp" "$FILE"
done
done
diff --git a/data/uncrustify.cfg b/data/uncrustify.cfg
new file mode 100644
index 000000000..d8975f58f
--- /dev/null
+++ b/data/uncrustify.cfg
@@ -0,0 +1,107 @@
+# indent using tabs
+output_tab_size = 2
+indent_columns = output_tab_size
+indent_with_tabs = 0
+
+# indent case
+indent_switch_case = indent_columns
+indent_case_brace = 0
+
+indent_ternary_operator = 2
+
+# newlines
+newlines = lf
+nl_after_semicolon = true
+nl_start_of_file = remove
+nl_end_of_file = force
+nl_end_of_file_min = 1
+
+# spaces
+sp_return_paren = force # "return (1);" vs "return(1);"
+sp_sizeof_paren = force # "sizeof (int)" vs "sizeof(int)"
+sp_assign = force
+sp_arith = force
+sp_bool = force
+sp_compare = force
+sp_after_comma = force
+sp_case_label = force
+sp_else_brace = force
+sp_brace_else = force
+sp_func_call_paren = force # "foo (" vs "foo("
+sp_func_proto_paren = force # "int foo ();" vs "int foo();"
+sp_before_ptr_star = force
+sp_after_ptr_star_qualifier = force # "const char * const" vs. "const char *const"
+sp_after_ptr_star = remove
+sp_between_ptr_star = remove # "**var" vs "* *var"
+sp_inside_paren = remove # "( 1 )" vs "(1)"
+sp_inside_fparen = remove # "( 1 )" vs "(1)" - functions
+sp_inside_sparen = remove # "( 1 )" vs "(1)" - if/for/etc
+sp_after_cast = remove # "(int) a" vs "(int)a"
+sp_func_call_user_paren = remove # For gettext, "_()" vs. "_ ()"
+set func_call_user _ N_ C_ # Needed for sp_after_cast
+sp_before_semi = remove
+sp_paren_paren = remove # Space between (( and ))
+
+eat_blanks_before_close_brace = true
+eat_blanks_after_open_brace = true
+
+# K&R style for curly braces
+nl_assign_brace = remove
+nl_enum_brace = remove # "enum {" vs "enum \n {"
+nl_union_brace = remove # "union {" vs "union \n {"
+nl_struct_brace = remove # "struct {" vs "struct \n {"
+nl_do_brace = remove # "do {" vs "do \n {"
+nl_if_brace = remove # "if () {" vs "if () \n {"
+nl_for_brace = remove # "for () {" vs "for () \n {"
+nl_else_brace = remove # "else {" vs "else \n {"
+nl_elseif_brace = remove # "else if {" vs "else if \n {"
+nl_while_brace = remove # "while () {" vs "while () \n {"
+nl_switch_brace = remove # "switch () {" vs "switch () \n {"
+nl_before_case = false
+nl_fcall_brace = add # "foo() {" vs "foo()\n{"
+nl_fdef_brace = add # "int foo() {" vs "int foo()\n{"
+nl_brace_while = remove
+nl_brace_else = remove
+nl_squeeze_ifdef = true
+nl_case_colon_brace = remove
+nl_after_brace_open = true
+
+# Function calls and parameters
+nl_func_paren = remove
+nl_func_def_paren = remove
+nl_func_decl_start = remove
+nl_func_def_start = remove
+nl_func_decl_args = force
+nl_func_def_args = force
+nl_func_decl_end = remove
+nl_func_def_end = remove
+
+# Code modifying options (non-whitespace)
+mod_remove_extra_semicolon = true
+
+# Align
+align_func_params = true
+align_single_line_func = true
+align_var_def_star_style = 2
+
+# one liners
+nl_func_leave_one_liners = true
+nl_enum_leave_one_liners = true
+nl_assign_leave_one_liners = true
+
+# Comments
+cmt_cpp_to_c = true # "/* */" vs. "//"
+cmt_convert_tab_to_spaces = true
+cmt_star_cont = true # Whether to put a star on subsequent comment lines
+cmt_sp_after_star_cont = 1 # The number of spaces to insert after the star on
subsequent comment lines
+cmt_reflow_mode = 2
+cmt_c_nl_start = false # false/true
+cmt_c_nl_end = true # false/true
+# For multi-line comments with a '*' lead, remove leading spaces if the first and last lines of
+# the comment are the same length. Default=True
+cmt_multi_check_last = true
+
+# Encoding
+utf8_bom = remove
+utf8_force = true
+
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]