aerialship / SamlSPBundle

SAML 2.0 Symfony SP Bundle - new version available at
http://www.lightsaml.com/SP-Bundle/
MIT License
63 stars 43 forks source link

#72 - Add code styling standards for contributors #73

Closed BernardoSilva closed 9 years ago

BernardoSilva commented 9 years ago

This PR is for issue #72

tmilos commented 9 years ago

Why don't we put this to be executed on CI rather then as commit hook?

scrutinizer-notifier commented 9 years ago

The inspection completed: No new issues

BernardoSilva commented 9 years ago

To ensure that developers always commit good code. This way if a developer make a change to code it will always commit clean formatted code, all consistent to whole project because the rules are the same to everyone. If we add this to CI it will check just for invalid syntax? Or event if we managed to make CI fix the code it will create strange commits just for code formatting? Or you know some better way of doing it @tmilos ?

tmilos commented 9 years ago

Didn't notice it's actually modifying files. Thought it's just syntax check. I'm used more to CI PSR check, but this might be fine too.

Was a bit skeptical how it would work on windows, but after fixing line 26 to be

        if [[ $i == *.php ]];

it works like a charm

So, please try if that works for you too, on Linux I guess, and we can merge it with that patch.

BernardoSilva commented 9 years ago

@tmilos Its working fine on mac. :+1:

tmilos commented 9 years ago

@BernardoSilva What are -p and --diff options? I don't find them in phpcbf -h

tmilos commented 9 years ago

I made PR #85 as alt to this one to solve conflicts. I also changed composer.json to require stable version of php_codesniffer. Guess that's ok

BernardoSilva commented 9 years ago

Cool. :+1: Those options may be available only for php-cs-fixer, I adapted this script to work with php_codesniffer. Those may be incompatible options with this bundle.