From 06cf6b611728096214d56ac6415f17f26511adf1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Milan=20Felix=20=C5=A0ulc?= Date: Mon, 12 Aug 2019 08:40:21 +0200 Subject: [PATCH] Sync with latest nette and contributte's repos --- .gitattributes | 1 + .travis.yml | 112 +++++++++---------------------------------------- Makefile | 28 +++++++++++++ README.md | 6 +-- composer.json | 46 +++++++------------- phpstan.neon | 5 --- ruleset.xml | 22 +++++----- 7 files changed, 79 insertions(+), 141 deletions(-) create mode 100644 Makefile diff --git a/.gitattributes b/.gitattributes index c52e7b9..12910b6 100644 --- a/.gitattributes +++ b/.gitattributes @@ -5,6 +5,7 @@ tests export-ignore .gitattributes export-ignore .gitignore export-ignore .travis.yml export-ignore +Makefile export-ignore phpstan.neon export-ignore README.md export-ignore ruleset.xml export-ignore diff --git a/.travis.yml b/.travis.yml index 48b030a..f6927d1 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,127 +1,55 @@ language: php php: - - 7.1 - 7.2 - 7.3 + - 7.4snapshot + - nightly before_install: - # Turn off XDebug - - phpenv config-rm xdebug.ini || return 0 + - phpenv config-rm xdebug.ini || return 0 # Turn off XDebug install: - # Composer - - travis_retry composer install --no-progress --prefer-dist + - travis_retry composer install --no-progress --prefer-dist # Install dependencies script: - # Tests - - composer run-script tests + - make tests # Tests after_failure: - # Print *.actual content - - for i in $(find tests -name \*.actual); do echo "--- $i"; cat $i; echo; echo; done + - for i in $(find tests -name \*.actual); do echo "--- $i"; cat $i; echo; echo; done # Print *.actual content jobs: include: - - env: title="Lowest Dependencies 7.1" - php: 7.1 + - env: title="Lowest Dependencies 7.2" + php: 7.2 install: - - travis_retry composer update --no-progress --prefer-dist --prefer-lowest + - travis_retry composer update --no-progress --prefer-dist --prefer-lowest --prefer-stable script: - - composer run-script tests + - make tests - stage: Quality Assurance - php: 7.1 + php: 7.3 script: - - composer run-script qa - - - stage: Phpstan - php: 7.1 - script: - - composer run-script phpstan-install - - composer run-script phpstan - - - stage: Test Coverage - if: branch = master AND type = push - php: 7.1 - script: - - composer run-script coverage - after_script: - - wget https://github.com/php-coveralls/php-coveralls/releases/download/v2.1.0/php-coveralls.phar - - php php-coveralls.phar --verbose --config tests/.coveralls.yml - - - stage: Outdated Dependencies - if: branch = master AND type = cron - php: 7.1 - script: - - composer outdated --direct --strict - - allow_failures: - - stage: Test Coverage - -sudo: false - -cache: - directories: - - $HOME/.composer/cache -language: php -php: - - 7.1 - - 7.2 - - 7.3 - -before_install: - # Turn off XDebug - - phpenv config-rm xdebug.ini || return 0 - -install: - # Composer - - travis_retry composer install --no-progress --prefer-dist - -script: - # Tests - - composer run-script tests - -after_failure: - # Print *.actual content - - for i in $(find tests -name \*.actual); do echo "--- $i"; cat $i; echo; echo; done - -jobs: - include: - - env: title="Lowest Dependencies 7.1" - php: 7.1 - install: - - travis_retry composer update --no-progress --prefer-dist --prefer-lowest - script: - - composer run-script tests - - - stage: Quality Assurance - php: 7.1 - script: - - composer run-script qa - - - stage: Phpstan - php: 7.1 - script: - - composer run-script phpstan-install - - composer run-script phpstan + - make qa - stage: Test Coverage if: branch = master AND type = push - php: 7.1 + php: 7.3 script: - - composer run-script coverage + - make coverage after_script: - - wget https://github.com/php-coveralls/php-coveralls/releases/download/v2.1.0/php-coveralls.phar - - php php-coveralls.phar --verbose --config tests/.coveralls.yml + - composer global require php-coveralls/php-coveralls ^2.1.0 + - ~/.composer/vendor/bin/php-coveralls --verbose --config tests/.coveralls.yml - stage: Outdated Dependencies if: branch = master AND type = cron - php: 7.1 + php: 7.3 script: - - composer outdated --direct --strict + - composer outdated --direct allow_failures: - stage: Test Coverage + - php: 7.4snapshot + - php: nightly sudo: false diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..b3cb81b --- /dev/null +++ b/Makefile @@ -0,0 +1,28 @@ +.PHONY: qa lint cs csf phpstan tests coverage + +all: + @$(MAKE) -pRrq -f $(lastword $(MAKEFILE_LIST)) : 2>/dev/null | awk -v RS= -F: '/^# File/,/^# Finished Make data base/ {if ($$1 !~ "^[#.]") {print $$1}}' | sort | egrep -v -e '^[^[:alnum:]]' -e '^$@$$' | xargs + +vendor: composer.json composer.lock + composer install + +qa: lint phpstan cs + +lint: vendor + vendor/bin/linter src tests + +cs: vendor + vendor/bin/codesniffer src tests + +csf: vendor + vendor/bin/codefixer src tests + +phpstan: vendor + vendor/bin/phpstan analyse -l max -c phpstan.neon src + +tests: vendor + vendor/bin/tester -s -p php --colors 1 -C tests/cases + +coverage: vendor + vendor/bin/tester -s -p phpdbg --colors 1 -C --coverage ./coverage.xml --coverage-src ./src tests/cases + diff --git a/README.md b/README.md index 99aee29..1203133 100644 --- a/README.md +++ b/README.md @@ -26,13 +26,13 @@ composer require contributte/latte-parsedown-extra | State | Version | Branch | PHP | |-------------|----------|----------|----------| -| dev | `^1.4.0` | `master` | `>= 7.1` | -| stable | `^1.3.0` | `master` | `>= 7.1` | +| dev | `^1.6.0` | `master` | `^7.2` | +| stable | `^1.5.0` | `master` | `^7.2` | +| stable | `^1.4.0` | `master` | `>= 7.1` | | stable | `^1.2.0` | `master` | `>= 5.6` | ## Overview - - [Usage - how to install](https://github.com/contributte/latte-parsedown-extra/blob/master/.docs/README.md#usage) - [Extension - how to configure](https://github.com/contributte/latte-parsedown-extra/blob/master/.docs/README.md#configuration) diff --git a/composer.json b/composer.json index d0568a9..5a2fe8b 100644 --- a/composer.json +++ b/composer.json @@ -1,6 +1,6 @@ { "name": "contributte/latte-parsedown-extra", - "description": "ParsedownExtra parser for Latte", + "description": "ParsedownExtra / Markdown parser for Latte", "type": "library", "license": "MIT", "homepage": "https://github.com/contributte/latte-parsedown-extra", @@ -12,49 +12,35 @@ ], "require": { "php": "^7.2", - "nette/di": "~3.0.0", - "nette/utils": "~3.0.0", - "latte/latte": "~2.5.1", + "erusev/parsedown": "~1.7.3", "erusev/parsedown-extra": "^0.7.1", - "erusev/parsedown": "~1.7.1" + "latte/latte": "~2.5.1", + "nette/di": "^3.0", + "nette/utils": "~3.0.0" }, "require-dev": { "ninjify/qa": "^0.9", "ninjify/nunjuck": "^0.2", - "nette/application": "~3.0.0" + "nette/application": "~3.0.0", + "phpstan/extension-installer": "^1.0", + "phpstan/phpstan-deprecation-rules": "^0.11", + "phpstan/phpstan-nette": "^0.11", + "phpstan/phpstan-shim": "^0.11", + "phpstan/phpstan-strict-rules": "^0.11" }, - "minimum-stability": "dev", - "prefer-stable": true, "autoload": { "psr-4": { "Contributte\\Parsedown\\": "src/" } }, - "scripts": { - "qa": [ - "linter src tests", - "codesniffer src tests" - ], - "tests": [ - "tester -s -p php --colors 1 -C tests/cases" - ], - "coverage": [ - "tester -s -p phpdbg --colors 1 -C --coverage ./coverage.xml --coverage-src ./src tests/cases" - ], - "phpstan-install": [ - "mkdir -p temp/phpstan", - "composer require -d temp/phpstan phpstan/phpstan:^0.10", - "composer require -d temp/phpstan phpstan/phpstan-deprecation-rules:^0.10", - "composer require -d temp/phpstan phpstan/phpstan-nette:^0.10", - "composer require -d temp/phpstan phpstan/phpstan-strict-rules:^0.10" - ], - "phpstan": [ - "temp/phpstan/vendor/bin/phpstan analyse -l max -c phpstan.neon src" - ] + "minimum-stability": "dev", + "prefer-stable": true, + "config": { + "sort-packages": true }, "extra": { "branch-alias": { - "dev-master": "1.4.x-dev" + "dev-master": "1.6.x-dev" } } } diff --git a/phpstan.neon b/phpstan.neon index 4148de4..e69de29 100644 --- a/phpstan.neon +++ b/phpstan.neon @@ -1,5 +0,0 @@ -includes: - - temp/phpstan/vendor/phpstan/phpstan-deprecation-rules/rules.neon - - temp/phpstan/vendor/phpstan/phpstan-nette/extension.neon - - temp/phpstan/vendor/phpstan/phpstan-nette/rules.neon - - temp/phpstan/vendor/phpstan/phpstan-strict-rules/rules.neon diff --git a/ruleset.xml b/ruleset.xml index e5efebb..05bd93c 100644 --- a/ruleset.xml +++ b/ruleset.xml @@ -1,20 +1,20 @@ - + - - - - - + + + + + - - /tests/tmp + + /tests/tmp