Sonata CI 9 роки тому
батько
коміт
9cb059e002

+ 3 - 0
.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/SonataAdminBundle.git
+    - XMLLINT_INDENT="    "
 
 matrix:
   fast_finish: true

+ 0 - 1
.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;

+ 1 - 1
.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;

+ 2 - 0
.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

+ 7 - 2
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
 

+ 4 - 0
Makefile

@@ -9,6 +9,10 @@ all:
 
 lint:
 	composer validate
+	find . -name '*.yml' -not -path './vendor/*' | xargs yaml-lint
+	find . \( -name '*.xml' -or -name '*.xliff' \) -not -path './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