Skip to content

Commit

Permalink
🔧 Use CS fixer in Travis instead of PrettyCI
Browse files Browse the repository at this point in the history
PrettyCI will be shut down at the end of the year
  • Loading branch information
B-Galati committed May 19, 2020
1 parent 727706b commit 5a45512
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 8 deletions.
4 changes: 3 additions & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ matrix:
- php: 7.2
- php: 7.3
- php: 7.4
env: CS=1

allow_failures:
- php: 7.4
Expand All @@ -29,4 +30,5 @@ before_install:
- make vendor

script:
- make tests-ci
- make tests-without-cs
- if [[ ${CS} == 1 ]]; then make cs-check; fi
14 changes: 7 additions & 7 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -17,12 +17,12 @@ composer.lock: composer.json
composer update $(COMPOSER_UPDATE_FLAGS)
@touch $@

.PHONY: tests-ci tests
tests-ci: composer-validate phpstan phpunit
tests: tests-ci cs-check ## Run all tests
.PHONY: tests tests-without-cs
tests-without-cs: composer-validate phpstan phpunit ## Run all tests but code style check
tests: tests-without-cs cs-check ## Run all tests

.PHONY: composer-validate
composer-validate: vendor composer.json composer.lock ## Validate composer.json file
composer-validate: vendor ## Validate composer.json file
composer validate

.PHONY: phpstan
Expand All @@ -33,10 +33,10 @@ phpstan: vendor ## Check PHP code style
phpunit: vendor ## Run PhpUnit tests
vendor/bin/phpunit -v

.PHONY: php-cs-fixer-check
.PHONY: cs-check
cs-check: vendor ## Check php code style
vendor/bin/php-cs-fixer fix --diff --dry-run --no-interaction -v --cache-file=.php_cs.cache --stop-on-violation

.PHONY: vendor cs-fix
cs-fix: ## Automatically php code style
.PHONY: cs-fix
cs-fix: vendor ## Automatically fix php code style
vendor/bin/php-cs-fixer fix -v --cache-file=.php_cs.cache

0 comments on commit 5a45512

Please sign in to comment.