diff options
Diffstat (limited to 'contrib/conf')
-rwxr-xr-x | contrib/conf/commit-msg | 34 | ||||
-rw-r--r-- | contrib/conf/gnunet/gnunet-system.conf | 14 | ||||
-rw-r--r-- | contrib/conf/gnunet/gnunet-user.conf | 4 | ||||
-rw-r--r-- | contrib/conf/gnunet/meson.build | 6 | ||||
-rw-r--r-- | contrib/conf/gnunet/no_autostart_above_core.conf | 6 | ||||
-rw-r--r-- | contrib/conf/gnunet/no_forcestart.conf | 6 | ||||
-rw-r--r-- | contrib/conf/meson.build | 1 | ||||
-rwxr-xr-x | contrib/conf/prepare-commit-msg | 37 | ||||
-rw-r--r-- | contrib/conf/uncrustify.cfg | 19 | ||||
-rwxr-xr-x | contrib/conf/uncrustify_precommit | 11 |
10 files changed, 113 insertions, 25 deletions
diff --git a/contrib/conf/commit-msg b/contrib/conf/commit-msg new file mode 100755 index 000000000..e57333c00 --- /dev/null +++ b/contrib/conf/commit-msg | |||
@@ -0,0 +1,34 @@ | |||
1 | #!/bin/bash | ||
2 | |||
3 | # use as .git/hooks/commit-msg | ||
4 | |||
5 | COMMIT_MSG_FILE=$1 | ||
6 | |||
7 | exec 1>&2 | ||
8 | |||
9 | RET=0 | ||
10 | changed=$(git diff --cached --name-only) | ||
11 | |||
12 | for f in $changed; | ||
13 | do | ||
14 | # Only headers in include | ||
15 | if echo $f | grep \src\/include\/.\*\.h\$ > /dev/null | ||
16 | then | ||
17 | RET=1 | ||
18 | # Check if it has a NEWS line | ||
19 | if cat $COMMIT_MSG_FILE | grep -i "^NEWS:\s[-,a-zA-Z][a-zA-Z]*" > /dev/null | ||
20 | then | ||
21 | RET=0 | ||
22 | break | ||
23 | fi | ||
24 | fi | ||
25 | done | ||
26 | |||
27 | # If no NEWS line found, abort | ||
28 | if [ $RET = 1 ]; | ||
29 | then | ||
30 | echo "Your commit includes staged changes that indicate an API change which requires a NEWS line." | ||
31 | else | ||
32 | echo "Your commit does not include API changes" | ||
33 | fi | ||
34 | exit 0 | ||
diff --git a/contrib/conf/gnunet/gnunet-system.conf b/contrib/conf/gnunet/gnunet-system.conf index 6f9b0f379..dc0528cf3 100644 --- a/contrib/conf/gnunet/gnunet-system.conf +++ b/contrib/conf/gnunet/gnunet-system.conf | |||
@@ -1,7 +1,9 @@ | |||
1 | # Sample configuration file to be installed in /etc/gnunet.conf | 1 | [path] |
2 | # for a multi-user GNUnet setup. This is then the configuration | 2 | GNUNET_HOME = /var/lib/gnunet/ |
3 | # for the system-wide "gnunet" user. | 3 | GNUNET_DATA_HOME = /var/lib/gnunet/data/ |
4 | [arm] | 4 | GNUNET_RUNTIME_DIR = /var/run/gnunet/ |
5 | SYSTEM_ONLY = YES | ||
6 | USER_ONLY = NO | ||
7 | 5 | ||
6 | [arm] | ||
7 | START_SYSTEM_SERVICES = YES | ||
8 | START_USER_SERVICES = NO | ||
9 | OPTIONS = -l /var/log/gnunet.log | ||
diff --git a/contrib/conf/gnunet/gnunet-user.conf b/contrib/conf/gnunet/gnunet-user.conf index de95c216c..f4763e45a 100644 --- a/contrib/conf/gnunet/gnunet-user.conf +++ b/contrib/conf/gnunet/gnunet-user.conf | |||
@@ -3,6 +3,6 @@ | |||
3 | # in the $HOME directory of each normal user (and in | 3 | # in the $HOME directory of each normal user (and in |
4 | # /etc/skel/). | 4 | # /etc/skel/). |
5 | [arm] | 5 | [arm] |
6 | SYSTEM_ONLY = NO | 6 | START_SYSTEM_SERVICES = NO |
7 | USER_ONLY = YES | 7 | START_USER_SERVICES = YES |
8 | 8 | ||
diff --git a/contrib/conf/gnunet/meson.build b/contrib/conf/gnunet/meson.build new file mode 100644 index 000000000..0419784fb --- /dev/null +++ b/contrib/conf/gnunet/meson.build | |||
@@ -0,0 +1,6 @@ | |||
1 | configure_file(copy: true, | ||
2 | input: 'no_forcestart.conf', | ||
3 | output: 'no_forcestart.conf') | ||
4 | configure_file(copy: true, | ||
5 | input: 'no_autostart_above_core.conf', | ||
6 | output: 'no_autostart_above_core.conf') | ||
diff --git a/contrib/conf/gnunet/no_autostart_above_core.conf b/contrib/conf/gnunet/no_autostart_above_core.conf index 478addd29..8ed4dcb60 100644 --- a/contrib/conf/gnunet/no_autostart_above_core.conf +++ b/contrib/conf/gnunet/no_autostart_above_core.conf | |||
@@ -74,9 +74,6 @@ START_ON_DEMAND = NO | |||
74 | [social] | 74 | [social] |
75 | START_ON_DEMAND = NO | 75 | START_ON_DEMAND = NO |
76 | 76 | ||
77 | [psyc] | ||
78 | START_ON_DEMAND = NO | ||
79 | |||
80 | [rps] | 77 | [rps] |
81 | START_ON_DEMAND = NO | 78 | START_ON_DEMAND = NO |
82 | 79 | ||
@@ -89,8 +86,5 @@ START_ON_DEMAND = NO | |||
89 | [sensor] | 86 | [sensor] |
90 | START_ON_DEMAND = NO | 87 | START_ON_DEMAND = NO |
91 | 88 | ||
92 | [zonemaster-monitor] | ||
93 | START_ON_DEMAND = NO | ||
94 | |||
95 | [zonemaster] | 89 | [zonemaster] |
96 | START_ON_DEMAND = NO | 90 | START_ON_DEMAND = NO |
diff --git a/contrib/conf/gnunet/no_forcestart.conf b/contrib/conf/gnunet/no_forcestart.conf index 2c874489e..0c4a209be 100644 --- a/contrib/conf/gnunet/no_forcestart.conf +++ b/contrib/conf/gnunet/no_forcestart.conf | |||
@@ -40,12 +40,6 @@ IMMEDIATE_START = NO | |||
40 | [zonemaster] | 40 | [zonemaster] |
41 | IMMEDIATE_START = NO | 41 | IMMEDIATE_START = NO |
42 | 42 | ||
43 | [zonemaster-monitor] | ||
44 | IMMEDIATE_START = NO | ||
45 | |||
46 | [psyc] | ||
47 | IMMEDIATE_START = NO | ||
48 | |||
49 | [rps] | 43 | [rps] |
50 | IMMEDIATE_START = NO | 44 | IMMEDIATE_START = NO |
51 | 45 | ||
diff --git a/contrib/conf/meson.build b/contrib/conf/meson.build new file mode 100644 index 000000000..f0e4647df --- /dev/null +++ b/contrib/conf/meson.build | |||
@@ -0,0 +1 @@ | |||
subdir('gnunet') | |||
diff --git a/contrib/conf/prepare-commit-msg b/contrib/conf/prepare-commit-msg new file mode 100755 index 000000000..a95f29430 --- /dev/null +++ b/contrib/conf/prepare-commit-msg | |||
@@ -0,0 +1,37 @@ | |||
1 | #!/bin/bash | ||
2 | |||
3 | # use as .git/hooks/pre-commit | ||
4 | |||
5 | COMMIT_MSG_FILE=$1 | ||
6 | COMMIT_SOURCE=$2 | ||
7 | SHA1=$3 | ||
8 | |||
9 | exec 1>&2 | ||
10 | |||
11 | RET=0 | ||
12 | changed=$(git diff --cached --name-only) | ||
13 | |||
14 | for f in $changed; | ||
15 | do | ||
16 | # Only headers in include | ||
17 | if echo $f | grep \src\/include\/.\*\.h\$ > /dev/null | ||
18 | then | ||
19 | RET=1 | ||
20 | fi | ||
21 | done | ||
22 | |||
23 | # Only add custom message when there is no commit source | ||
24 | # ($COMMIT_SOURCE is empty). Otherwise, keep the default message | ||
25 | # proposed by Git. Possible commit source: message, template, | ||
26 | # merge, squash or commit. | ||
27 | if [ -z "$COMMIT_SOURCE" ]; | ||
28 | then | ||
29 | hint=$(cat "$COMMIT_MSG_FILE") | ||
30 | echo -e "# Our commit subject format policy is:\n# <subsystem>: <description>\n# Adding 'Issue #1234'/'Fixes #1234' into the description will automatically update/resolve issue #1234 in mantis." > "$COMMIT_MSG_FILE" | ||
31 | if [ $RET = 1 ]; | ||
32 | then | ||
33 | echo -e "# Your commit includes staged changes that indicate an API change which requires a NEWS line." >> "$COMMIT_MSG_FILE" | ||
34 | fi | ||
35 | echo "$hint" >> "$COMMIT_MSG_FILE" | ||
36 | fi | ||
37 | exit 0 | ||
diff --git a/contrib/conf/uncrustify.cfg b/contrib/conf/uncrustify.cfg index b02ebc4a5..af2d8e69c 100644 --- a/contrib/conf/uncrustify.cfg +++ b/contrib/conf/uncrustify.cfg | |||
@@ -4,7 +4,7 @@ output_tab_size = 2 | |||
4 | indent_columns = 2 | 4 | indent_columns = 2 |
5 | indent_with_tabs = 0 | 5 | indent_with_tabs = 0 |
6 | indent_case_brace = 2 | 6 | indent_case_brace = 2 |
7 | indent_label=0 | 7 | indent_label=-16 |
8 | 8 | ||
9 | code_width=80 | 9 | code_width=80 |
10 | #cmd_width=80 | 10 | #cmd_width=80 |
@@ -49,8 +49,12 @@ nl_assign_brace=remove | |||
49 | 49 | ||
50 | # No extra newlines that cause noisy diffs | 50 | # No extra newlines that cause noisy diffs |
51 | nl_start_of_file=remove | 51 | nl_start_of_file=remove |
52 | nl_after_func_proto = 2 | ||
53 | nl_after_func_body = 3 | ||
52 | # If there's no new line, it's not a text file! | 54 | # If there's no new line, it's not a text file! |
53 | nl_end_of_file=add | 55 | nl_end_of_file=add |
56 | nl_max_blank_in_func = 3 | ||
57 | nl_max = 3 | ||
54 | 58 | ||
55 | sp_inside_paren = remove | 59 | sp_inside_paren = remove |
56 | 60 | ||
@@ -69,6 +73,7 @@ sp_between_ptr_star = remove | |||
69 | sp_before_sparen = add | 73 | sp_before_sparen = add |
70 | 74 | ||
71 | sp_inside_fparen = remove | 75 | sp_inside_fparen = remove |
76 | sp_inside_sparen = remove | ||
72 | 77 | ||
73 | # add space before function call and decl: "foo (x)" | 78 | # add space before function call and decl: "foo (x)" |
74 | sp_func_call_paren = add | 79 | sp_func_call_paren = add |
@@ -76,3 +81,15 @@ sp_func_proto_paren = add | |||
76 | sp_func_proto_paren_empty = add | 81 | sp_func_proto_paren_empty = add |
77 | sp_func_def_paren = add | 82 | sp_func_def_paren = add |
78 | sp_func_def_paren_empty = add | 83 | sp_func_def_paren_empty = add |
84 | |||
85 | # We'd want it for "if ( (foo) || (bar) )", but not for "if (m())", | ||
86 | # so as uncrustify doesn't give exactly what we want => ignore | ||
87 | sp_paren_paren = ignore | ||
88 | sp_inside_paren = remove | ||
89 | sp_bool = force | ||
90 | |||
91 | nl_func_type_name = force | ||
92 | #nl_branch_else = add | ||
93 | nl_else_brace = add | ||
94 | nl_elseif_brace = add | ||
95 | nl_for_brace = add | ||
diff --git a/contrib/conf/uncrustify_precommit b/contrib/conf/uncrustify_precommit index 3a06511d1..8e0a605b3 100755 --- a/contrib/conf/uncrustify_precommit +++ b/contrib/conf/uncrustify_precommit | |||
@@ -28,8 +28,11 @@ done | |||
28 | 28 | ||
29 | if [ $RET = 1 ]; | 29 | if [ $RET = 1 ]; |
30 | then | 30 | then |
31 | echo "Run" | 31 | echo "================================================================" |
32 | echo "uncrustify --replace -c uncrustify.cfg ${crustified}" | 32 | echo " Your changes are ugly! " |
33 | echo "before committing." | 33 | echo " Uncrustify your code in your next commit. " |
34 | echo " See https://docs.gnunet.org/latest/developers/style.html#coding-style " | ||
35 | echo "================================================================" | ||
34 | fi | 36 | fi |
35 | exit $RET | 37 | # Do not fail |
38 | exit 0 | ||