From 8a47b5ddffb66dd5f62033abd65126f3bb753d35 Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Sun, 3 Mar 2019 15:58:26 -0300 Subject: Add ci checks for bad new lines or trailing white spaces --- .tools/jobs/newlines.sh | 10 ++++++++++ .tools/jobs/spaces.sh | 10 ++++++++++ 2 files changed, 20 insertions(+) create mode 100755 .tools/jobs/newlines.sh create mode 100755 .tools/jobs/spaces.sh (limited to '.tools') diff --git a/.tools/jobs/newlines.sh b/.tools/jobs/newlines.sh new file mode 100755 index 000000000..23309f70d --- /dev/null +++ b/.tools/jobs/newlines.sh @@ -0,0 +1,10 @@ +#!/bin/bash + +find -H . -type f -name "*.txt" -o -name "*.conf" -exec dos2unix {} \; + +export RES=$(git diff --name-only) +if [[ -n "${RES}" ]]; then + echo "Wrong new lines detected in files:" + git diff --name-only + exit 1 +fi diff --git a/.tools/jobs/spaces.sh b/.tools/jobs/spaces.sh new file mode 100755 index 000000000..b0f485dbe --- /dev/null +++ b/.tools/jobs/spaces.sh @@ -0,0 +1,10 @@ +#!/bin/bash + +find -H . -type f -name "*.txt" -exec sed -i 's/[[:blank:]]*$//' {} \; + +export RES=$(git diff --name-only) +if [[ -n "${RES}" ]]; then + echo "Extra spaces before new lines detected in files:" + git diff --name-only + exit 1 +fi -- cgit v1.2.3-60-g2f50