norminette version check and checkforbiddensourceheader

This commit is contained in:
Timo Schmidt 2023-03-28 19:36:45 +02:00
parent 92052a8c2b
commit 8b918d5a49
1 changed files with 8 additions and 1 deletions

View File

@ -11,6 +11,13 @@ alias gca='git add -u && git commit -m "Automatic add"'
alias watch='watch -cn.1' alias watch='watch -cn.1'
alias push='git push origin master ; git push gitea master' alias push='git push origin master ; git push gitea master'
alias norm='alacritty -e sh -c '\''git rev-parse --show-toplevel || { echo "Exiting in 5" ; sleep 1 ; echo "Exiting in 4" ; sleep 1 ; echo "Exiting in 3" ; sleep 1 ; echo "Exiting in 2" ; sleep 1 ; echo "Exiting in 1" ; sleep 1 ; } && cd "$(git rev-parse --show-toplevel)" && watch -cn.5 date \&\& norminette -R CheckForbiddenSourceHeader'\'' & disown' alias norm='alacritty -e sh -c '\''git rev-parse --show-toplevel || { echo "Exiting in 5" ; sleep 1 ; echo "Exiting in 4" ; sleep 1 ; echo "Exiting in 3" ; sleep 1 ; echo "Exiting in 2" ; sleep 1 ; echo "Exiting in 1" ; sleep 1 ; } && cd "$(git rev-parse --show-toplevel)" && watch -cn.5 date \&\& norminette -R CheckForbiddenSourceHeader'\'' & disown'
norminette () {
version="$($(type -P norminette) -v | cut -d" " -f2)"
if [ ! "${version}" = "3.3.50" ]; then
printf "%s\n" "Your norminette version is not 3.3.50, but ${version}, which will not catch some indentation errors. Please up-/downgrade. Exiting"
fi
$(type -P norminette) "$@"
}
jmp () { jmp () {
cd "$(find . -name "${1}" -not -wholename "*mouli*" -print -quit)" cd "$(find . -name "${1}" -not -wholename "*mouli*" -print -quit)"
if [ "${?}" = "0" ] ; then if [ "${?}" = "0" ] ; then
@ -80,7 +87,7 @@ check () {
# Only proceed if clone success # Only proceed if clone success
if [ -d "${DIR}" ] ; then if [ -d "${DIR}" ] ; then
# Check the norm and print beautiful message # Check the norm and print beautiful message
norminette "${DIR}" && printf '\033[30;102m%s\033[m\n' "Norminette success" || printf '\033[30;101m%s\033[m\n' "Norminette fail!!!" norminette -R CheckForbiddenSourceHeader "${DIR}" && printf '\033[30;102m%s\033[m\n' "Norminette success" || printf '\033[30;101m%s\033[m\n' "Norminette fail!!!"
# Remove temp folder # Remove temp folder
rm -rf "${DIR}" rm -rf "${DIR}"