X-Git-Url: https://git.auder.net/?p=valse.git;a=blobdiff_plain;f=hooks%2Fpre-commit;h=24babdb8efecb0f886b1978860a3b053b4e6c060;hp=f9649b36cc649bf71f80fc1f944ecd4d395a6ad8;hb=430a98439a49281c4b17801c95da3e6d9ef88488;hpb=7a56cc1804edcc2bb3ca3e4a8589faf55eb03547 diff --git a/hooks/pre-commit b/hooks/pre-commit index f9649b3..24babdb 100755 --- a/hooks/pre-commit +++ b/hooks/pre-commit @@ -15,7 +15,7 @@ indent() { fi # loop on modified files - git diff --cached --name-only $against |while read file; + git diff --cached --name-only $against | while read file; do local ext=$(expr "$file" : ".*\(\..*\)") case $ext in @@ -28,10 +28,6 @@ indent() { # Indent the file with `indent' if this is a R file __indent_R() { - if test ! -x "$INDENT" - then - return; - fi if test ! -f $file then return; @@ -39,7 +35,7 @@ __indent_R() { echo "Indenting " $file echo "library(formatR);formatR::tidy_source('$file',comment=TRUE,blank=TRUE, - arrow=TRUE,brace.newline=TRUE,indent=2,width.cutoff=80,file='$file')" | R --slave + arrow=TRUE,brace.newline=TRUE,indent=2,width.cutoff=90,file='$file')" | R --slave git add "$file" }