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
pull/2907/head
SaitTalhaNisanci 2019-12-09 14:23:53 +03:00 committed by GitHub
parent 10f2d7c078
commit 91f8be76e1
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 15 additions and 1 deletions

View File

@ -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

14
ci/fix_style.sh Executable file
View File

@ -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