Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Enhancement: Synchronize project tooling configuration with localheinz/repository #141

Merged
merged 1 commit into from
Dec 24, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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