move configs in contrib to conf
authorng0 <ng0@n0.is>
Thu, 21 Nov 2019 10:50:02 +0000 (10:50 +0000)
committerng0 <ng0@n0.is>
Thu, 21 Nov 2019 10:50:02 +0000 (10:50 +0000)
contrib/conf/tox.ini [new file with mode: 0644]
contrib/conf/uncrustify.cfg [new file with mode: 0644]
contrib/conf/uncrustify_precommit [new file with mode: 0755]
contrib/tox.ini [deleted file]
contrib/uncrustify.cfg [deleted file]
contrib/uncrustify_precommit [deleted file]

diff --git a/contrib/conf/tox.ini b/contrib/conf/tox.ini
new file mode 100644 (file)
index 0000000..aee00e3
--- /dev/null
@@ -0,0 +1,4 @@
+[flake8]
+max-line-length = 160
+exclude = .git *.bak
+filename = *.py*
\ No newline at end of file
diff --git a/contrib/conf/uncrustify.cfg b/contrib/conf/uncrustify.cfg
new file mode 100644 (file)
index 0000000..8c9df2c
--- /dev/null
@@ -0,0 +1,95 @@
+input_tab_size = 2
+output_tab_size = 2
+
+indent_columns = 2
+indent_with_tabs = 0
+indent_case_brace = 2
+indent_label=-16
+
+code_width=80
+#cmd_width=80
+
+# Leave most comments alone for now
+cmt_indent_multi=false
+sp_cmt_cpp_start=add
+
+sp_not=add
+
+sp_func_call_user_paren_paren=remove
+sp_inside_fparen=remove
+sp_after_cast=add
+
+ls_for_split_full=true
+ls_func_split_full=true
+ls_code_width=true
+
+# Arithmetic operations in wrapped expressions should be at the start
+# of the line.
+pos_arith=lead
+
+# Fully parenthesize boolean exprs
+mod_full_paren_if_bool=true
+
+# Braces should be on their own line
+nl_fdef_brace=add
+nl_enum_brace=add
+nl_struct_brace=add
+nl_union_brace=add
+nl_if_brace=add
+nl_brace_else=add
+nl_elseif_brace=add
+nl_while_brace=add
+nl_switch_brace=add
+
+# no newline between "else" and "if"
+nl_else_if=remove
+
+nl_func_paren=remove
+nl_assign_brace=remove
+
+# No extra newlines that cause noisy diffs
+nl_start_of_file=remove
+nl_after_func_proto = 2
+nl_after_func_body = 3
+# If there's no new line, it's not a text file!
+nl_end_of_file=add
+nl_max_blank_in_func = 3
+nl_max = 3
+
+sp_inside_paren = remove
+
+sp_arith = add
+sp_arith_additive = add
+
+# We want spaces before and after "="
+sp_before_assign = add
+sp_after_assign = add
+
+# we want "char *foo;"
+sp_after_ptr_star = remove
+sp_between_ptr_star = remove
+
+# we want "if (foo) { ... }"
+sp_before_sparen = add
+
+sp_inside_fparen = remove
+sp_inside_sparen = remove
+
+# add space before function call and decl: "foo (x)"
+sp_func_call_paren = add
+sp_func_proto_paren = add
+sp_func_proto_paren_empty = add
+sp_func_def_paren = add
+sp_func_def_paren_empty = add
+
+# We'd want it for "if ( (foo) || (bar) )", but not for "if (m())",
+# so as uncrustify doesn't give exactly what we want => ignore
+sp_paren_paren = ignore
+sp_inside_paren = remove
+sp_bool = force
+
+nl_func_type_name = force
+#nl_branch_else = add
+nl_else_brace = add
+nl_elseif_brace = add
+nl_for_brace = add
diff --git a/contrib/conf/uncrustify_precommit b/contrib/conf/uncrustify_precommit
new file mode 100755 (executable)
index 0000000..fd29998
--- /dev/null
@@ -0,0 +1,35 @@
+#!/bin/sh
+
+# use as .git/hooks/pre-commit
+
+exec 1>&2
+
+RET=0
+changed=$(git diff --cached --name-only)
+crustified=""
+
+for f in $changed;
+do
+ if echo $f | grep \\.[c,h]\$ > /dev/null
+ then
+    # compare result of uncrustify with changes
+    #
+    # only change any of the invocations here if
+    # they are portable across all cmp and shell
+    # implementations !
+    uncrustify -q -c uncrustify.cfg -f $f | cmp -s $f -
+    if test $? = 1 ;
+    then
+      crustified=" $crustified $f"
+      RET=1
+    fi
+  fi
+done
+
+if [ $RET = 1 ];
+then
+  echo "Run"
+  echo "uncrustify --no-backup -c uncrustify.cfg ${crustified}"
+  echo "before commiting."
+fi
+exit $RET
diff --git a/contrib/tox.ini b/contrib/tox.ini
deleted file mode 100644 (file)
index aee00e3..0000000
+++ /dev/null
@@ -1,4 +0,0 @@
-[flake8]
-max-line-length = 160
-exclude = .git *.bak
-filename = *.py*
\ No newline at end of file
diff --git a/contrib/uncrustify.cfg b/contrib/uncrustify.cfg
deleted file mode 100644 (file)
index 8c9df2c..0000000
+++ /dev/null
@@ -1,95 +0,0 @@
-input_tab_size = 2
-output_tab_size = 2
-
-indent_columns = 2
-indent_with_tabs = 0
-indent_case_brace = 2
-indent_label=-16
-
-code_width=80
-#cmd_width=80
-
-# Leave most comments alone for now
-cmt_indent_multi=false
-sp_cmt_cpp_start=add
-
-sp_not=add
-
-sp_func_call_user_paren_paren=remove
-sp_inside_fparen=remove
-sp_after_cast=add
-
-ls_for_split_full=true
-ls_func_split_full=true
-ls_code_width=true
-
-# Arithmetic operations in wrapped expressions should be at the start
-# of the line.
-pos_arith=lead
-
-# Fully parenthesize boolean exprs
-mod_full_paren_if_bool=true
-
-# Braces should be on their own line
-nl_fdef_brace=add
-nl_enum_brace=add
-nl_struct_brace=add
-nl_union_brace=add
-nl_if_brace=add
-nl_brace_else=add
-nl_elseif_brace=add
-nl_while_brace=add
-nl_switch_brace=add
-
-# no newline between "else" and "if"
-nl_else_if=remove
-
-nl_func_paren=remove
-nl_assign_brace=remove
-
-# No extra newlines that cause noisy diffs
-nl_start_of_file=remove
-nl_after_func_proto = 2
-nl_after_func_body = 3
-# If there's no new line, it's not a text file!
-nl_end_of_file=add
-nl_max_blank_in_func = 3
-nl_max = 3
-
-sp_inside_paren = remove
-
-sp_arith = add
-sp_arith_additive = add
-
-# We want spaces before and after "="
-sp_before_assign = add
-sp_after_assign = add
-
-# we want "char *foo;"
-sp_after_ptr_star = remove
-sp_between_ptr_star = remove
-
-# we want "if (foo) { ... }"
-sp_before_sparen = add
-
-sp_inside_fparen = remove
-sp_inside_sparen = remove
-
-# add space before function call and decl: "foo (x)"
-sp_func_call_paren = add
-sp_func_proto_paren = add
-sp_func_proto_paren_empty = add
-sp_func_def_paren = add
-sp_func_def_paren_empty = add
-
-# We'd want it for "if ( (foo) || (bar) )", but not for "if (m())",
-# so as uncrustify doesn't give exactly what we want => ignore
-sp_paren_paren = ignore
-sp_inside_paren = remove
-sp_bool = force
-
-nl_func_type_name = force
-#nl_branch_else = add
-nl_else_brace = add
-nl_elseif_brace = add
-nl_for_brace = add
diff --git a/contrib/uncrustify_precommit b/contrib/uncrustify_precommit
deleted file mode 100755 (executable)
index fd29998..0000000
+++ /dev/null
@@ -1,35 +0,0 @@
-#!/bin/sh
-
-# use as .git/hooks/pre-commit
-
-exec 1>&2
-
-RET=0
-changed=$(git diff --cached --name-only)
-crustified=""
-
-for f in $changed;
-do
- if echo $f | grep \\.[c,h]\$ > /dev/null
- then
-    # compare result of uncrustify with changes
-    #
-    # only change any of the invocations here if
-    # they are portable across all cmp and shell
-    # implementations !
-    uncrustify -q -c uncrustify.cfg -f $f | cmp -s $f -
-    if test $? = 1 ;
-    then
-      crustified=" $crustified $f"
-      RET=1
-    fi
-  fi
-done
-
-if [ $RET = 1 ];
-then
-  echo "Run"
-  echo "uncrustify --no-backup -c uncrustify.cfg ${crustified}"
-  echo "before commiting."
-fi
-exit $RET