From 49bcfe462c46343257320cede60b32ef0f719dff Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gr=C3=A9goire=20Paris?= Date: Fri, 20 Mar 2015 17:52:45 +0100 Subject: [PATCH] add syntax checker for xlf --- docs/hooks/syntax-checker.md | 5 ++++- template/hooks/syntaxchecker/xlf.sh | 7 +++++++ 2 files changed, 11 insertions(+), 1 deletion(-) create mode 100644 template/hooks/syntaxchecker/xlf.sh diff --git a/docs/hooks/syntax-checker.md b/docs/hooks/syntax-checker.md index 20943fa..2b958ff 100644 --- a/docs/hooks/syntax-checker.md +++ b/docs/hooks/syntax-checker.md @@ -1,7 +1,10 @@ # Description Checks for syntax errors in files that have a checker, based on the file extension. -For the moment, there only is a php checker, located at `hooks/syntaxchecker/php/check.sh`. +For the moment, there is : + +- a php checker, located at `hooks/syntaxchecker/php.sh`; +- an xliff checker, located at `hooks/syntaxchecker/xlf.sh`. This hook is language-agnostic. diff --git a/template/hooks/syntaxchecker/xlf.sh b/template/hooks/syntaxchecker/xlf.sh new file mode 100644 index 0000000..45fdbb4 --- /dev/null +++ b/template/hooks/syntaxchecker/xlf.sh @@ -0,0 +1,7 @@ +#!/bin/sh + +type xmllint > /dev/null 2>&1 +if [ $? -eq 0 ] +then + xmllint $FILE > /dev/null +fi