From bbfe99f737260caf02da0a7066dbaa3639af0920 Mon Sep 17 00:00:00 2001 From: SonataCI Date: Wed, 8 Jun 2016 01:48:47 +0200 Subject: [PATCH 1/2] DevKit updates --- .travis.yml | 3 +++ .travis/before_install_test.sh | 1 - .travis/check_relevant_lint.sh | 2 +- .travis/install_lint.sh | 2 ++ CONTRIBUTING.md | 9 +++++++-- Makefile | 5 +++++ 6 files changed, 18 insertions(+), 4 deletions(-) diff --git a/.travis.yml b/.travis.yml index 4b2e46f49..89543d984 100644 --- a/.travis.yml +++ b/.travis.yml @@ -21,6 +21,8 @@ php: sudo: false cache: + timeout: 86400 + pip: true directories: - $HOME/.composer/cache/files @@ -30,6 +32,7 @@ env: - SYMFONY_DEPRECATIONS_HELPER=weak - TARGET=test - UPSTREAM_URL=https://github.com/sonata-project/SonataUserBundle.git + - XMLLINT_INDENT=" " matrix: fast_finish: true diff --git a/.travis/before_install_test.sh b/.travis/before_install_test.sh index 5e0f68067..61b4c7703 100755 --- a/.travis/before_install_test.sh +++ b/.travis/before_install_test.sh @@ -12,7 +12,6 @@ fi # To be removed when following PR will be merged: https://github.com/travis-ci/travis-build/pull/718 composer self-update --stable -composer config --quiet --global github-oauth.github.com $GITHUB_OAUTH_TOKEN sed --in-place "s/\"dev-master\":/\"dev-${TRAVIS_COMMIT}\":/" composer.json if [ "$SYMFONY" != "" ]; then composer require "symfony/symfony:$SYMFONY" --no-update; fi; diff --git a/.travis/check_relevant_lint.sh b/.travis/check_relevant_lint.sh index 7a42dcbd5..42be76763 100755 --- a/.travis/check_relevant_lint.sh +++ b/.travis/check_relevant_lint.sh @@ -1,6 +1,6 @@ #!/usr/bin/env bash set -ev -RELEVANT_FILES=$(git diff --name-only HEAD upstream/${TRAVIS_BRANCH} -- *.{json}) +RELEVANT_FILES=$(git diff --name-only HEAD upstream/${TRAVIS_BRANCH} -- '*.json' '*.yml' '*.xml' '*.xliff') if [[ -z ${RELEVANT_FILES} ]]; then echo -n 'KO'; exit 0; fi; diff --git a/.travis/install_lint.sh b/.travis/install_lint.sh index 4c8f60ad0..ab8f0f390 100755 --- a/.travis/install_lint.sh +++ b/.travis/install_lint.sh @@ -2,3 +2,5 @@ set -ev composer global require sllh/composer-lint:@stable --prefer-dist --no-interaction + +gem install yaml-lint diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 04c1926ac..7da7b09eb 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -13,8 +13,11 @@ Thanks for your interest in Sonata projects! First, check if you are up to date: is your version still supported, and are you using the latest patch version? -If you are not sure this is a bug, consider posting your question on [Stack -Overflow](http://stackoverflow.com), using one of the sonata tags. +GitHub Issues is for **issues**, as opposed to question on how to use Sonata. +If you are not sure this is a bug, or simply want to ask such a question, +please post your question on [Stack Overflow](http://stackoverflow.com/questions/tagged/sonata), +using the `sonata` tags. + If you happen to find a bug, we kindly request you report it. However, before submitting it, please check the [project documentation available online](https://sonata-project.org/bundles/). @@ -88,8 +91,10 @@ Some rules have to be respected about the test: * `@codeCoverageIgnoreStart` * `@codeCoverageIgnoreEnd` * All test methods should be prefixed by `test`. Example: `public function testItReturnsNull()`. +* All test method names must be in camel case format. * 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`. +* The `@expectedException*` annotations are prohibited. Use `PHPUnit_Framework_TestCase::setExpectedException()`. ### Writing a Pull Request diff --git a/Makefile b/Makefile index de0af3a76..e27d3cd38 100644 --- a/Makefile +++ b/Makefile @@ -9,6 +9,11 @@ all: lint: composer validate + find . -name '*.yml' -not -path './vendor/*' -not -path './Resources/public/vendor/*' | xargs yaml-lint + find . \( -name '*.xml' -or -name '*.xliff' \) \ + -not -path './vendor/*' -not -path './Resources/public/vendor/*' -type f \ + -exec xmllint --encode UTF-8 --output '{}' --format '{}' \; + git diff --exit-code test: phpunit -c phpunit.xml.dist --coverage-clover build/logs/clover.xml From 2780662ab6f23d4e7550a5f431620863ce684bec Mon Sep 17 00:00:00 2001 From: SonataCI Date: Wed, 8 Jun 2016 01:55:41 +0200 Subject: [PATCH 2/2] DevKit updates --- .travis.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index 89543d984..12067a9fb 100644 --- a/.travis.yml +++ b/.travis.yml @@ -21,7 +21,6 @@ php: sudo: false cache: - timeout: 86400 pip: true directories: - $HOME/.composer/cache/files