diff options
author | mannol <eniz_vukovic@hotmail.com> | 2015-04-29 01:02:47 +0200 |
---|---|---|
committer | mannol <eniz_vukovic@hotmail.com> | 2015-04-29 01:02:47 +0200 |
commit | d8c34f4ffafedc256e9a52af5e591c4998c0003d (patch) | |
tree | 190b3605de8f24a85caace8a841115e96dc4e539 /other/astyle | |
parent | 9bba7a0434d0967d5dd76b8afc7783ea2edad0cf (diff) | |
parent | 3454bc7da78e467f55f6b7fea4e03775d2649a63 (diff) |
Merge branch 'master' into new_api
Diffstat (limited to 'other/astyle')
-rw-r--r-- | other/astyle/README | 11 | ||||
-rw-r--r-- | other/astyle/astylerc | 11 | ||||
-rw-r--r-- | other/astyle/pre-commit | 17 |
3 files changed, 39 insertions, 0 deletions
diff --git a/other/astyle/README b/other/astyle/README new file mode 100644 index 00000000..26802ec7 --- /dev/null +++ b/other/astyle/README | |||
@@ -0,0 +1,11 @@ | |||
1 | This directory can house various tools and utilities. | ||
2 | |||
3 | astylerc | ||
4 | - This file can be used in the precommit hook to try its best | ||
5 | at making the code conform to the coding style document. | ||
6 | |||
7 | pre-commit (*NIX only at the moment) | ||
8 | - Lints your file in adherence to the coding style doucment as | ||
9 | best as possible in terms of spacing, indenting, etc. | ||
10 | - Requires you to have astyle installed. | ||
11 | - To use, copy this file to ProjectTox-Core/.git/hooks | ||
diff --git a/other/astyle/astylerc b/other/astyle/astylerc new file mode 100644 index 00000000..dd738b74 --- /dev/null +++ b/other/astyle/astylerc | |||
@@ -0,0 +1,11 @@ | |||
1 | --style=kr | ||
2 | --pad-header | ||
3 | --max-code-length=120 | ||
4 | --convert-tabs | ||
5 | --indent-switches | ||
6 | --pad-oper | ||
7 | --align-pointer=name | ||
8 | --align-reference=name | ||
9 | --preserve-date | ||
10 | --lineend=linux | ||
11 | --break-blocks \ No newline at end of file | ||
diff --git a/other/astyle/pre-commit b/other/astyle/pre-commit new file mode 100644 index 00000000..8f91779d --- /dev/null +++ b/other/astyle/pre-commit | |||
@@ -0,0 +1,17 @@ | |||
1 | #!/usr/bin/env sh | ||
2 | # | ||
3 | # An example hook script to verify what is about to be committed. | ||
4 | # Called by "git commit" with no arguments. The hook should | ||
5 | # exit with non-zero status after issuing an appropriate message if | ||
6 | # it wants to stop the commit. | ||
7 | # | ||
8 | # To enable this hook, rename this file to "pre-commit". | ||
9 | |||
10 | for file in `git diff-index --diff-filter=ACMR --name-only HEAD`; do | ||
11 | if [[ $file == *.c || $file == *.h ]] | ||
12 | then | ||
13 | echo $file | ||
14 | `which astyle` $file --options=tools/astylerc | ||
15 | git add $file | ||
16 | fi | ||
17 | done \ No newline at end of file | ||