Giter VIP home page Giter VIP logo

framework's Introduction

sohoa

PHP framework based on Hoa

Convention de codage / PSR1-2 / Git hook:

Sohoa/Framework respecte PSR1 et PSR2 comme convention de codage. Pour faciliter le travail nous utilisons l'outil PHP-CS-Fixer permet de vérifier et corriger automatiquement le code qui ne respecte pas les standards PSR1 et 2. Avec la ligne de commande suivante :

php /path/to/php-cs-fixer.php fix /path/to/the/framework

On peut également ajouter cette vérification en hook de pre-commit pour Git. Il faut pour cela ajouter dans le dossier .git du dépôt local dans le fichier pre-commit une grande partie du code a été trouvé chez LilaConcepts

Simple vérification thanks to lilaconcepts
#!/bin/sh

PROJECTROOT=`echo $(cd ${0%/*}/../../ && pwd -P)`/
FIXER=php-cs-fixer.phar

if [ ! -e ${PROJECTROOT}${FIXER} ]; then
	echo "PHP-CS-Fixer not available, downloading to ${PROJECTROOT}${FIXER}..."
	curl -s http://cs.sensiolabs.org/get/$FIXER > ${PROJECTROOT}${FIXER}
	echo "Done. First time to check the Coding Standards."
	echo ""
fi

RES=`php ${PROJECTROOT}${FIXER} fix $PROJECTROOT --verbose --dry-run`
if [ "$RES" != "" ]; then
	echo "Coding standards are not correct, cancelling your commit."
	echo ""
	echo $RES
	echo ""
        echo "If you want to fix them run:"
	echo ""
	echo "    php ${PROJECTROOT}${FIXER} fix ${PROJECTROOT} --verbose"
	echo ""
	exit 1
fi

Tip

Pour commiter sans passer par le hook on peut utiliser la ligne de commande suivante :

git commit -m "message" --no-verify

framework's People

Contributors

guiled avatar maitrepylos avatar osaris avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.