From 422e74424a759c31d1dcfe0d1d9fbce3f39efb32 Mon Sep 17 00:00:00 2001 From: irungentoo Date: Sat, 25 Apr 2015 20:39:13 -0400 Subject: Switched tox.h to the dsl generated one. Added input file to generate it. Moved the astyle stuff to the astyle directory in other/. --- other/astyle/README | 11 +++++++++++ other/astyle/astylerc | 11 +++++++++++ other/astyle/pre-commit | 17 +++++++++++++++++ 3 files changed, 39 insertions(+) create mode 100644 other/astyle/README create mode 100644 other/astyle/astylerc create mode 100644 other/astyle/pre-commit (limited to 'other/astyle') 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 @@ +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 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 @@ +--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 \ 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 @@ +#!/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 \ No newline at end of file -- cgit v1.2.3