From 91f8be76e144aa5945ecf7722c475bcee27bd259 Mon Sep 17 00:00:00 2001 From: SaitTalhaNisanci Date: Mon, 9 Dec 2019 14:23:53 +0300 Subject: [PATCH] Add a script that fixes style related things (#3234) * Add a script that fixes style related things It is kind of tedious that we need make sure that every style check passes with any change we make. A script is added, which does all the things for us so that we dont have to run separate commands. * run fix style string in reindent target --- Makefile | 2 +- ci/fix_style.sh | 14 ++++++++++++++ 2 files changed, 15 insertions(+), 1 deletion(-) create mode 100755 ci/fix_style.sh diff --git a/Makefile b/Makefile index d2fc8e287..da8248964 100644 --- a/Makefile +++ b/Makefile @@ -34,7 +34,7 @@ clean: clean-extension # apply or check style reindent: - cd ${citus_abs_top_srcdir} && citus_indent --quiet + ${citus_abs_top_srcdir}/ci/fix_style.sh check-style: cd ${citus_abs_top_srcdir} && citus_indent --quiet --check .PHONY: reindent check-style diff --git a/ci/fix_style.sh b/ci/fix_style.sh new file mode 100755 index 000000000..ce0d93a38 --- /dev/null +++ b/ci/fix_style.sh @@ -0,0 +1,14 @@ +#!/bin/sh + +# fail if trying to reference a variable that is not set. +set -u / set -o nounset +# exit immediately if a command fails +set -e + +cidir="${0%/*}" +cd ${cidir}/.. + +ci/editorconfig.sh +ci/remove_useless_declarations.sh + +citus_indent . --quiet