mirror of
https://github.com/irungentoo/toxcore.git
synced 2024-03-22 13:30:51 +08:00
Merge pull request #457 from aaboagye/master
core,nTox,toxic - Fix for Issue #453. Begin refactoring w/astyle.
This commit is contained in:
commit
0a00c5c291
3
.gitignore
vendored
3
.gitignore
vendored
|
@ -30,3 +30,6 @@ tags
|
|||
|
||||
#netbeans
|
||||
nbproject
|
||||
|
||||
#astyle
|
||||
*.orig
|
||||
|
|
9
tools/README
Normal file
9
tools/README
Normal file
|
@ -0,0 +1,9 @@
|
|||
This directory can house various tools and utilities.
|
||||
|
||||
astylerc
|
||||
- This file can be used in the precommit hook to try its best at making the code conform to the coding style document.
|
||||
|
||||
pre-commit (*NIX only at the moment)
|
||||
- Lints your file in adherence to the coding style doucment as best as possible in terms of spacing, indenting, etc.
|
||||
- Requires you to have astyle installed.
|
||||
- To use, copy this file to ProjectTox-Core/.git/hooks
|
11
tools/astylerc
Normal file
11
tools/astylerc
Normal file
|
@ -0,0 +1,11 @@
|
|||
--style=kr
|
||||
--pad-header
|
||||
--max-code-length=120
|
||||
--convert-tabs
|
||||
--indent-switches
|
||||
--pad-oper
|
||||
--align-pointer=name
|
||||
--align-reference=name
|
||||
--preserve-date
|
||||
--lineend=linux
|
||||
--break-blocks
|
17
tools/pre-commit
Normal file
17
tools/pre-commit
Normal file
|
@ -0,0 +1,17 @@
|
|||
#!/usr/bin/env sh
|
||||
#
|
||||
# An example hook script to verify what is about to be committed.
|
||||
# Called by "git commit" with no arguments. The hook should
|
||||
# exit with non-zero status after issuing an appropriate message if
|
||||
# it wants to stop the commit.
|
||||
#
|
||||
# To enable this hook, rename this file to "pre-commit".
|
||||
|
||||
for file in `git diff-index --diff-filter=ACMR --name-only HEAD`; do
|
||||
if [[ $file == *.c || $file == *.h ]]
|
||||
then
|
||||
echo $file
|
||||
`which astyle` $file --options=tools/astylerc
|
||||
git add $file
|
||||
fi
|
||||
done
|
Loading…
Reference in New Issue
Block a user