Skip to content

Commit

Permalink
Enhancement: Synchronize project tooling configuration with localhein…
Browse files Browse the repository at this point in the history
…z/repository
  • Loading branch information
localheinz committed Dec 24, 2018
1 parent f20b80d commit 093f065
Show file tree
Hide file tree
Showing 7 changed files with 21 additions and 21 deletions.
5 changes: 1 addition & 4 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,5 +1,2 @@
/.php-cs-fixer/
/.phpstan/
/.phpunit/
/.tmp/
/.build/
/vendor/
5 changes: 2 additions & 3 deletions .php_cs
Original file line number Diff line number Diff line change
Expand Up @@ -27,15 +27,14 @@ $config->getFinder()
->ignoreDotFiles(false)
->in(__DIR__)
->exclude([
'.build',
'.github',
'.php-cs-fixer',
'.phpstan',
'.travis',
])
->name('.php_cs');

$directory = \getenv('TRAVIS') ? \getenv('HOME') : __DIR__;

$config->setCacheFile($directory . '/.php-cs-fixer/.php_cs.cache');
$config->setCacheFile($directory . '/.build/php-cs-fixer/.php_cs.cache');

return $config;
17 changes: 9 additions & 8 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@ env:
cache:
directories:
- $HOME/.composer/cache
- $HOME/.php-cs-fixer
- $HOME/.phpstan
- $HOME/.phpunit
- $HOME/.build/php-cs-fixer
- $HOME/.build/phpstan
- $HOME/.build/phpunit

stages:
- style
Expand All @@ -32,29 +32,30 @@ jobs:
- composer install

before_script:
- mkdir -p $HOME/.php-cs-fixer
- mkdir -p $HOME/.build/php-cs-fixer

script:
- vendor/bin/php-cs-fixer fix --config=.php_cs --diff --dry-run --verbose

- stage: Stan

php: 7.2
php: 7.3

before_install:
- source .travis/xdebug.sh
- xdebug-disable
- composer validate
- if [[ -n "$GITHUB_TOKEN" ]]; then composer config github-oauth.github.com $GITHUB_TOKEN; fi
- if [[ "$TRAVIS_PHP_VERSION" == "7.3" ]]; then composer remove --dev localheinz/php-cs-fixer-config; fi

install:
- composer install

before_script:
- mkdir -p $HOME/.phpstan
- mkdir -p $HOME/.build/phpstan

script:
- vendor/bin/phpstan analyse --configuration=phpstan.neon src test
- vendor/bin/phpstan analyse --configuration=phpstan.neon

- &TEST

Expand All @@ -69,9 +70,9 @@ jobs:
- xdebug-disable
- composer validate
- if [[ -n "$GITHUB_TOKEN" ]]; then composer config github-oauth.github.com $GITHUB_TOKEN; fi
- if [[ "$TRAVIS_PHP_VERSION" == "7.3" ]]; then composer remove --dev localheinz/php-cs-fixer-config; fi

install:
- if [[ "$TRAVIS_PHP_VERSION" == "7.3" ]]; then composer remove --dev localheinz/php-cs-fixer-config; fi
- if [[ "$WITH_LOWEST" == "true" ]]; then composer update --prefer-lowest; fi
- if [[ "$WITH_LOCKED" == "true" ]]; then composer install; fi
- if [[ "$WITH_HIGHEST" == "true" ]]; then composer update; fi
Expand Down
6 changes: 3 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,12 @@ coverage: vendor
vendor/bin/phpunit --configuration=test/Integration/phpunit.xml --coverage-text

cs: vendor
mkdir -p .php-cs-fixer
mkdir -p .build/php-cs-fixer
vendor/bin/php-cs-fixer fix --config=.php_cs --diff --verbose

stan: vendor
mkdir -p .phpstan
vendor/bin/phpstan analyse --configuration=phpstan.neon src test
mkdir -p .build/phpstan
vendor/bin/phpstan analyse --configuration=phpstan.neon

test: vendor
vendor/bin/phpunit --configuration=test/Integration/phpunit.xml
Expand Down
5 changes: 4 additions & 1 deletion phpstan.neon
Original file line number Diff line number Diff line change
Expand Up @@ -11,4 +11,7 @@ parameters:
- '#Method Localheinz\\Composer\\Normalize\\Command\\NormalizeCommand::__construct\(\) has parameter \$differ with null as default value.#'
- '#Method Localheinz\\Composer\\Normalize\\Command\\NormalizeCommand::__construct\(\) has parameter \$formatter with null as default value.#'
- '#Method Localheinz\\Composer\\Normalize\\Command\\NormalizeCommand::indentFrom\(\) has a nullable return type declaration.#'
tmpDir: %currentWorkingDirectory%/.phpstan
paths:
- src
- test
tmpDir: %currentWorkingDirectory%/.build/phpstan
2 changes: 1 addition & 1 deletion test/Integration/NormalizeTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -1035,7 +1035,7 @@ private static function temporaryDirectory(): string
$projectDirectory = \realpath(__DIR__ . '/../..');

return \sprintf(
'%s/.tmp',
'%s/.build/fixture',
$projectDirectory
);
}
Expand Down
2 changes: 1 addition & 1 deletion test/Integration/phpunit.xml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
beStrictAboutTodoAnnotatedTests="true"
bootstrap="../../vendor/autoload.php"
cacheResult="true"
cacheResultFile="../../.phpunit/unit.cache"
cacheResultFile="../../.build/phpunit/unit.cache"
colors="true"
columns="max"
convertErrorsToExceptions="true"
Expand Down

0 comments on commit 093f065

Please sign in to comment.