From 9396bfab63ce91d33a99ca181aa34138cbd0e9ca Mon Sep 17 00:00:00 2001 From: Luis Cordova Date: Sat, 12 Jul 2014 09:04:46 -0500 Subject: [PATCH] plug bldr and php_cs --- .bldr.yml | 317 +++++++++++++++++++ .editorconfig | 9 + .gitattributes | 2 + .php_cs | 51 +++ app/console | 2 +- composer.json | 2 +- src/Cordoval/Fixer/ShortArraySyntaxFixer.php | 0 7 files changed, 381 insertions(+), 2 deletions(-) create mode 100644 .bldr.yml create mode 100644 .editorconfig create mode 100644 .gitattributes create mode 100644 .php_cs create mode 100644 src/Cordoval/Fixer/ShortArraySyntaxFixer.php diff --git a/.bldr.yml b/.bldr.yml new file mode 100644 index 0000000..7098a62 --- /dev/null +++ b/.bldr.yml @@ -0,0 +1,317 @@ +bldr: + name: cordoval/matthew-7-12 + description: Matthew 7:12 project + profiles: + travisBeforeScript: + description: Travis Profile for running server:run + tasks: + - prepare + - lint + - phpcs + travisScript: + description: Travis Profile to run test suite + tasks: + - test + tdd: + description: Local Development Profile + tasks: + - testLocal + - watch + docker: + description: Docker setup + tasks: + - bootstrap + jenkins: + description: Jenkins profile + tasks: + - setup_jenkins + - lint + - phpcs + - test + cs: + description: fix cs for once + tasks: + - runFixer + tasks: + bootstrap: + calls: + - + type: exec + failOnError: true + executable: composer + arguments: [-q, install, --prefer-dist] + - + type: exec + failOnError: true + executable: cp + arguments: [app/config/parameters.yml.docker, app/config/parameters.yml] + - + type: exec + failOnError: true + executable: php + arguments: [app/console, doctrine:schema:update, --force, --env=dev] + - + type: exec + failOnError: true + executable: php + arguments: [app/console, doctrine:mongodb:schema:update, --env=dev] + - + type: exec + failOnError: true + executable: php + arguments: [app/console, cache:clear, --env=dev] + setup_jenkins: + calls: + - + type: exec + failOnError: true + executable: cp + arguments: [app/config/parameters.yml.jenkins, app/config/parameters.yml] + - + type: exec + failOnError: true + executable: composer + arguments: [-q, install, --prefer-dist] + - + type: exec + executable: php + arguments: [app/console, doctrine:database:drop, --force, --env=test] + - + type: exec + executable: php + arguments: [app/console, doctrine:database:create, --env=test] + - + type: exec + executable: php + arguments: [app/console, doctrine:schema:create, --env=test] + - + type: exec + executable: php + arguments: [app/console, doctrine:schema:update, --force, --env=test] + - + type: exec + executable: php + arguments: [app/console, doctrine:mongodb:schema:update, --env=test] + - + type: exec + executable: php + arguments: [app/console, cache:clear, --env=test] + prepare: + calls: + - + type: exec + failOnError: true + executable: cp + arguments: [app/config/parameters.yml.travis, app/config/parameters.yml] + - + type: exec + failOnError: true + executable: composer + arguments: [-q, install, --prefer-dist] + - + type: exec + executable: php + arguments: [app/console, doctrine:database:create, --env=test] + - + type: exec + executable: php + arguments: [app/console, doctrine:schema:create, --env=test] + - + type: exec + executable: php + arguments: [app/console, doctrine:schema:update, --force, --env=test] + - + type: exec + executable: php + arguments: [app/console, doctrine:mongodb:schema:update, --env=test] + - + type: exec + executable: php + arguments: [app/console, cache:clear, --env=test] + lint: + description: Lints the files of the project + calls: + - + type: apply + failOnError: true + src: + - { path: [src], files: *.php, recursive: true } + output: /dev/null + executable: php + arguments: [-l] + phpcs: + description: Runs the PHP Code Sniffer + calls: + - + type: exec + executable: php + arguments: + - bin/phpcs + - --standard=PSR2 + - --report=full + - src/ + - + type: exec + output: /dev/null + append: false + executable: php + arguments: + - bin/phpcs + - --standard=PSR2 + - --report=checkstyle + - --report-file=build/logs/checkstyle.xml + - src/ + test: + description: Runs the PHPUnit Tests + calls: + - + type: background + failOnEror: false + executable: ./dev_built_in_server + arguments: [] + - + type: exec + failOnError: true + executable: php + arguments: + - bin/phpunit + #- --exclude-group=travis + #- --coverage-text=php://stdout + testLocal: + description: Runs the PHPUnit Tests + calls: + - + type: exec + executable: clear + - + type: exec + executable: php + arguments: + - bin/phpunit + - --stop-on-failure + - --group=now + watch: + description: Watch Task for Local Development + calls: + - + type: watch + src: + - { path: [src], files: *.php, recursive: true } + task: testLocal + open: + description: Opens ticket from list by number and add label WIP + calls: + - + type: exec + executable: gush + arguments: + - i:take + - $CURRENT_TICKET + - + type: exec + executable: gush + arguments: + - issue:assign + - $CURRENT_TICKET + - + type: exec + executable: gush + arguments: + - issue:label:assign + - WIP + - + type: exec + executable: gush + arguments: + - issue:assign + - $CURRENT_TICKET + - $NEXT_USER + autopush: + description: Autocommit with the ticket name being the branch name + calls: + - + type: exec + executable: git + arguments: + - ca + - $BRANCH_NAME + - + type: exec + executable: gush + arguments: + - b:p + ready: + description: Makes the current branch and ticket ready by labeling it RFR + calls: + - + type: exec + executable: gush + arguments: + - issue:label:assign + - RFR + close: + description: Closes current PR ticket labeling it with OK and merging it + calls: + - + type: exec + executable: gush + arguments: + - issue:label:assign + - OK + - + type: exec + executable: gush + arguments: + - p:merge + - $CURRENT_TICKET + - + type: exec + executable: gush + arguments: + - b:d + - + type: exec + executable: git + arguments: + - checkout + - master + - + type: exec + executable: gush + arguments: + - b:s + - + type: exec + executable: git + arguments: + - branch + - -d + - - + bounce: + description: Bounces the ticket to be responsibility of the reviewer set + calls: + - + type: exec + executable: gush + arguments: + - issue:assign + - $CURRENT_TICKET + - $NEXT_USER + runFixer: + description: Installs if not already and runs php-cs-fixer with custom .php_cs + calls: + - + type: exec + executable: curl + arguments: + - http://cs.sensiolabs.org/get/php-cs-fixer.phar + - -S + - -o + - php-cs-fixer.phar + - + type: exec + executable: php + arguments: + - php-cs-fixer.phar + - fix + - . \ No newline at end of file diff --git a/.editorconfig b/.editorconfig new file mode 100644 index 0000000..8156c00 --- /dev/null +++ b/.editorconfig @@ -0,0 +1,9 @@ +root = true + +[*] +end_of_line = lf +charset = utf-8 +trim_trailing_whitespace = true +insert_final_newline = true +indent_style = spaces +indent_size = 4 diff --git a/.gitattributes b/.gitattributes new file mode 100644 index 0000000..dfe0770 --- /dev/null +++ b/.gitattributes @@ -0,0 +1,2 @@ +# Auto detect text files and perform LF normalization +* text=auto diff --git a/.php_cs b/.php_cs new file mode 100644 index 0000000..3846271 --- /dev/null +++ b/.php_cs @@ -0,0 +1,51 @@ +notName('README.md') + ->notName('CHANGELOG.md') + ->notName('.php_cs') + ->notName('composer.*') + ->notName('phpunit.xml*') + ->notName('*.txt') + ->exclude('app') + ->exclude('bin') + ->exclude('build') + ->exclude('jmeter') + ->exclude('nginx') + ->exclude('vendor') + ->exclude('web/bundles') + ->in(__DIR__) +; + +return Symfony\CS\Config\Config::create() + ->set + ->fixers( + array( + 'encoding', + 'linefeed', + 'indentation', + 'trailing_spaces', + 'object_operator', + 'phpdoc_params', + 'visibility', + 'short_tag', + 'php_closing_tag', + 'return', + 'extra_empty_lines', + 'braces', + 'lowercase_constants', + 'lowercase_keywords', + 'include', + 'function_declaration', + 'controls_spaces', + 'spaces_cast', + 'elseif', + 'eof_ending', + 'one_class_per_file', + 'unused_use', + ) + ) + ->finder($finder) +; \ No newline at end of file diff --git a/app/console b/app/console index 792c265..e139b04 100755 --- a/app/console +++ b/app/console @@ -3,7 +3,7 @@ set_time_limit(0); -require_once __DIR__.'/vendor/autoload.php'; +require_once __DIR__.'/../vendor/autoload.php'; use Symfony\Bundle\FrameworkBundle\Console\Application; use Symfony\Component\Console\Input\ArgvInput; diff --git a/composer.json b/composer.json index 145d3f8..66e0995 100644 --- a/composer.json +++ b/composer.json @@ -11,7 +11,7 @@ ] }, "require": { - "symfony/symfony": "2.6.x-dev", + "symfony/symfony": "~2.5.1", "doctrine/orm": "~2.2,>=2.2.3", "doctrine/doctrine-bundle": "~1.2.0", "twig/extensions": "~1.0.0", diff --git a/src/Cordoval/Fixer/ShortArraySyntaxFixer.php b/src/Cordoval/Fixer/ShortArraySyntaxFixer.php new file mode 100644 index 0000000..e69de29