From bf1b7222f14afe2c8a03ed111782e6d41f273da4 Mon Sep 17 00:00:00 2001 From: Dennis Eichhorn Date: Mon, 28 Oct 2019 21:10:08 +0100 Subject: [PATCH] remove travis because of bad business decisions! --- Hooks/travis.sh | 125 ------------------------------------------------ 1 file changed, 125 deletions(-) delete mode 100755 Hooks/travis.sh diff --git a/Hooks/travis.sh b/Hooks/travis.sh deleted file mode 100755 index cf34c65..0000000 --- a/Hooks/travis.sh +++ /dev/null @@ -1,125 +0,0 @@ -#!/bin/bash - -rootpath="$(pwd)" - -. ${rootpath}/Build/Hooks/logging.sh -. ${rootpath}/Build/Hooks/syntax.sh -. ${rootpath}/Build/Hooks/filename.sh -. ${rootpath}/Build/Hooks/tests.sh - -for FILE in $(git diff --cached --name-only); do - if [[ ! -f "$FILE" ]]; then - continue - fi - - # Filename - if [[ $(isValidFileName "$FILE") = 0 ]]; then - echo -e "\e[1;31m\tInvalid file name '$FILE'.\e[0m" >&2 - exit 1 - fi - - # Logging - if [[ "$FILE" =~ ^.+(php)$ ]] && [[ $(hasPhpLogging "$FILE") = 1 ]]; then - echo -e "\e[1;33m\tWarning, the commit contains a call to var_dump() in '$FILE'. Commit was not aborted, however.\e[0m" >&2 - fi - - if [[ "$FILE" =~ ^.+(js)$ ]] && [[ $(hasJsLogging "$FILE") = 1 ]]; then - echo -e "\e[1;33m\tWarning, the commit contains a call to console.log() in '$FILE'. Commit was not aborted, however.\e[0m" >&2 - fi - - # Tests - if [[ "$FILE" =~ ^.+(php)$ ]] && [[ $(isPhanTestSuccessful "$FILE") = 0 ]]; then - echo -e "\e[1;31m\tPhan error.\e[0m" >&2 - exit 1 - fi - - if [[ "$FILE" =~ ^.+(php)$ ]] && [[ $(isPhpStanTestSuccessful "$FILE") = 0 ]]; then - echo -e "\e[1;31m\tPhp stan error.\e[0m" >&2 - exit 1 - fi - - # Syntax - if [[ "$FILE" =~ ^.+(php)$ ]]; then - PHP_SYNTAX=$(hasInvalidPhpSyntax "$FILE") - - if [[ $PHP_SYNTAX = 1 ]]; then - echo -e "\e[1;31m\tPhp linting error.\e[0m" >&2 - exit 1 - fi - - if [[ $PHP_SYNTAX = 2 ]]; then - echo -e "\e[1;31m\tCode Sniffer error.\e[0m" >&2 - php -d memory_limit=4G ${rootpath}/vendor/bin/phpcs --standard="${rootpath}/Build/Config/phpcs.xml" --encoding=utf-8 -n -p "$FILE" - exit 1 - fi - - if [[ $PHP_SYNTAX = 3 ]]; then - echo -e "\e[1;31m\tMess Detector error.\e[0m" >&2 - exit 1 - fi - fi - - if [[ "$FILE" =~ ^.+(sh)$ ]] && [[ $(isValidBashScript "$FILE") = 0 ]]; then - echo -e "\e[1;31m\tBash linting error in '$FILE'.\e[0m" >&2 - exit 1 - fi - - if [[ "$FILE" =~ ^.+(sh|js|php|json|css)$ ]]; then - GEN_SYNTAX=$(hasInvalidBasicSyntax "$FILE") - - if [[ $GEN_SYNTAX = 1 ]]; then - echo -e "\e[1;31m\tFound whitespace at end of line in $FILE.\e[0m" >&2 - grep -P ' $' $FILE >&2 - exit 1 - fi - - if [[ $GEN_SYNTAX = 2 ]]; then - echo -e "\e[1;31m\tFound tab instead of whitespace $FILE.\e[0m" >&2 - grep -P '\t' $FILE >&2 - exit 1 - fi - fi - - if [[ "$FILE" =~ ^.+(tpl\.php|html)$ ]]; then - TPL_SYNTAX=$(hasInvalidHtmlTemplateContent "$FILE") - - if [[ $TPL_SYNTAX = 1 ]]; then - echo -e "\e[1;31m\tFound missing image alt attribute.\e[0m" >&2 - grep -P '(\)' "$FILE" >&2 - exit 1 - fi - - if [[ $TPL_SYNTAX = 2 ]]; then - echo -e "\e[1;31m\tFound missing input type attribute.\e[0m" >&2 - grep -P '()' "$FILE" >&2 - exit 1 - fi - - if [[ $TPL_SYNTAX = 3 ]]; then - echo -e "\e[1;31m\tFound missing form element name.\e[0m" >&2 - grep -P '()' "$FILE" >&2 - exit 1 - fi - - if [[ $TPL_SYNTAX = 4 ]]; then - echo -e "\e[1;31m\tFound missing form element name or id.\e[0m" >&2 - grep -P '(\)' "$FILE" >&2 - exit 1 - fi - - if [[ $TPL_SYNTAX = 5 ]]; then - echo -e "\e[1;31m\tFound inline styles.\e[0m" >&2 - grep -P '(style=)' "$FILE" >&2 - fi - - if [[ $TPL_SYNTAX = 6 ]]; then - echo -e "\e[1;31m\tAttribute description should not be hard coded.\e[0m" >&2 - grep -P '(value|title|alt|aria\-label)(=\")((?!\<\?).)*(>)' "$FILE" >&2 - fi - - if [[ $TPL_SYNTAX = 7 ]]; then - echo -e "\e[1;31m\tFound hard coded text.\e[0m" >&2 - grep -P '(\|\|\|\)[0-9a-zA-Z\.\?]+' "$FILE" >&2 - fi - fi -done \ No newline at end of file