Skip to content

Commit

Permalink
DevKit updates (sonata-project#3901)
Browse files Browse the repository at this point in the history
  • Loading branch information
SonataCI committed Jun 1, 2016
1 parent 38eda83 commit f3a30f8
Show file tree
Hide file tree
Showing 7 changed files with 67 additions and 2 deletions.
13 changes: 13 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,11 @@
#
# It's auto-generated by sonata-project/dev-kit package.

branches:
only:
- master
- 3.x

language: php

php:
Expand All @@ -24,12 +29,15 @@ env:
- PATH="$HOME/.local/bin:$PATH"
- SYMFONY_DEPRECATIONS_HELPER=weak
- TARGET=test
- UPSTREAM_URL=https://github.com/sonata-project/SonataAdminBundle.git

matrix:
fast_finish: true
include:
- php: '7.0'
env: TARGET=docs
- php: '7.0'
env: TARGET=lint
- php: '5.3'
env: COMPOSER_FLAGS="--prefer-lowest"
- php: '7.0'
Expand All @@ -40,6 +48,8 @@ matrix:
env: SYMFONY=2.8.*
- php: '7.0'
env: SYMFONY=3.0.*
- php: '7.0'
env: SYMFONY=3.1.*
- php: '7.0'
env: SYMFONY=dev-master@dev
- php: '7.0'
Expand All @@ -61,6 +71,9 @@ matrix:
- env: SONATA_BLOCK=dev-master@dev

before_install:
- git remote add upstream ${UPSTREAM_URL} && git fetch --all
- if [[ -x .travis/check_relevant_${TARGET}.sh && "$TRAVIS_PULL_REQUEST" != "false" ]]; then export RELEVANT=$(.travis/check_relevant_${TARGET}.sh); fi;
- if [[ ! -z ${RELEVANT} ]];then exit 0; fi;
- if [ -x .travis/before_install_${TARGET}.sh ]; then .travis/before_install_${TARGET}.sh; fi;

install:
Expand Down
6 changes: 6 additions & 0 deletions .travis/check_relevant_docs.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
#!/usr/bin/env bash
set -ev

RELEVANT_FILES=$(git diff --name-only HEAD upstream/${TRAVIS_BRANCH} -- '*.rst')

if [[ -z ${RELEVANT_FILES} ]]; then echo -n 'KO'; exit 0; fi;
6 changes: 6 additions & 0 deletions .travis/check_relevant_lint.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
#!/usr/bin/env bash
set -ev

RELEVANT_FILES=$(git diff --name-only HEAD upstream/${TRAVIS_BRANCH} -- *.{json})

if [[ -z ${RELEVANT_FILES} ]]; then echo -n 'KO'; exit 0; fi;
6 changes: 6 additions & 0 deletions .travis/check_relevant_test.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
#!/usr/bin/env bash
set -ev

RELEVANT_FILES=$(git diff --name-only HEAD upstream/${TRAVIS_BRANCH} -- *.{php,yml,xml,twig,js,css,json})

if [[ -z ${RELEVANT_FILES} ]]; then echo -n 'KO'; exit 0; fi;
4 changes: 4 additions & 0 deletions .travis/install_lint.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
#!/usr/bin/env sh
set -ev

composer global require sllh/composer-lint:@stable --prefer-dist --no-interaction
31 changes: 29 additions & 2 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,9 @@ All the sonata team will be glad to review your code changes propositions! :smil

But please, read the following before.

### Coding style
### The content

#### Coding style

Each project follows [PSR-1](http://www.php-fig.org/psr/psr-1/), [PSR-2](http://www.php-fig.org/psr/psr-2/)
and [Symfony Coding Standards](http://symfony.com/doc/current/contributing/code/standards.html) for coding style,
Expand All @@ -64,9 +66,34 @@ and run this command before committing your modifications:
php-cs-fixer fix --verbose
```

#### The documentation

The documentation is mostly written with the `rst` format. You can test the doc rendering with the `make docs` command.

If your PR contains a new feature, you must add documentation for it.

#### The tests

If your PR contains a fix, tests should be added to prove the bug.

If your PR contains an addition, a new feature, this one has to be fully covered by tests.

Some rules have to be respected about the test:

* Annotations about coverage are prohibited. This concerns:
* `@covers`
* `@coversDefaultClass`
* `@coversNothing`
* `@codeCoverageIgnore`
* `@codeCoverageIgnoreStart`
* `codeCoverageIgnoreEnd`
* All test methods should be prefixed by `test`. Example: `public function testItReturnsNull()`.
* As opposed, the `@test` annotation is prohibited.
* Most of the time, the test class should have the same name as the targeted class, suffixed by `Test`.

### Writing a Pull Request

#### The content
#### The subject

Ideally, a Pull Request should concern one and **only one** subject, so that it
remains clear, and independent changes can be merged quickly.
Expand Down
3 changes: 3 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,9 @@
all:
@echo "Please choose a task."

lint:
composer validate

test:
phpunit -c phpunit.xml.dist --coverage-clover build/logs/clover.xml

Expand Down

0 comments on commit f3a30f8

Please sign in to comment.