Skip to content

Commit

Permalink
plug bldr and php_cs
Browse files Browse the repository at this point in the history
  • Loading branch information
cordoval committed Jul 12, 2014
1 parent 4f2144c commit 9396bfa
Show file tree
Hide file tree
Showing 7 changed files with 381 additions and 2 deletions.
317 changes: 317 additions & 0 deletions .bldr.yml
Original file line number Diff line number Diff line change
@@ -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
- .
9 changes: 9 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -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
2 changes: 2 additions & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
# Auto detect text files and perform LF normalization
* text=auto
51 changes: 51 additions & 0 deletions .php_cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
<?php

require_once __DIR__.'/src/Cordoval/Fixer/ShortArraySyntaxFixer.php';

$finder = Symfony\CS\Finder\DefaultFinder::create()
->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)
;
2 changes: 1 addition & 1 deletion app/console
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
Loading

0 comments on commit 9396bfa

Please sign in to comment.