Skip to content
Snippets Groups Projects
Select Git revision
  • b3ae8966b7a1a7384a46c74355617f046b6eb402
  • main default
  • 35-cgu
  • 34-peertube-support
  • 27-add-autoplay-to-iframe
  • 33-bug-on-youtube-embed-urls
  • RC-Rekall-v1.1-fix_lpo
  • tuleap-140-go-back-to-my-capsules-page-when-i-m-on-capsule-preview-page
  • RC-Rekall-v1.2-fix10
  • RC-Rekall-v1.2-fix9
  • RC-Rekall-v1.2-fix8
  • RC-Rekall-v1.2-fix7
  • RC-Rekall-v1.2-fix6
  • RC-Rekall-v1.2-fix5
  • RC-Rekall-v1.2-fix4
  • RC-Rekall-v1.2-fix3
  • RC-Rekall-v1.2-fix2
  • RC-Rekall-v1.2-fix1
  • RC-Rekall-v1.1-fix-3
  • RC-Rekall-v1.1-fix-2
  • RC-Rekall-v1.1-fix-1
  • RC-Rekall-v1.1-delivered
  • preprod20220209-1535
23 results

pre-commit

Blame
  • pre-commit 1.34 KiB
    #!/bin/bash
    
    REDBOLD='\033[0;31;1m'
    GREENBOLD='\033[0;32;1m'
    BOLD='\033[1m'
    NORMAL='\033[0m'
    if [ ! -z "$(which docker-compose)" ]; then
        docker="docker-compose exec -T memorekall-member"
    fi
    composer="$docker composer"
    npm="$docker npm"
    
    echo -e "\n ${BOLD} Starting Unit and Functional Tests...\n ${NORMAL}"
    $composer tests
    if [ $? != 0 ]; then
    	echo -e "\n ${REDBOLD} Unit tests failed \n ${NORMAL}"
    	exit 1;
    else
    	echo -e "\n ${GREENBOLD} Unit and functional tests passed successfully! ${NORMAL} \n"
    fi
    
    echo -e "\n ${BOLD} Starting PHP_CodeSniffer... \n ${NORMAL}"
    $composer phpcs
    if [ $? != 0 ]; then
    	echo -e "\n ${REDBOLD} PHPCS verification failed \n ${NORMAL}"
    	exit 1;
    else
    	echo -e "\n ${GREENBOLD} Your code passed PHP_CodeSniffer successfully! ${NORMAL} \n"
    fi
    
    echo -e "\n ${BOLD} Starting PHPStan... \n ${NORMAL}"
    $composer phpstan
    if [ $? != 0 ]; then
    	echo -e "\n ${REDBOLD} PHPStan verification failed \n ${NORMAL}"
    	exit 1;
    else
    	echo -e "\n ${GREENBOLD} Your code passed static analysis successfully! \n
    	\n Committing your changes now... \n ${NORMAL}"
    fi
    
    echo -e "\n ${BOLD} Starting ESLint... \n ${NORMAL}"
    $npm run lint
    if [ $? != 0 ]; then
    	echo -e "\n ${REDBOLD} ESLint verification failed \n ${NORMAL}"
    	exit 1;
    else
    	echo -e "\n ${GREENBOLD} Your code passed JS linter successfully! \n
    	\n Committing your changes now... \n ${NORMAL}"
    fi