Skip to content

Commit

Permalink
Sync with latest nette and contributte's repos
Browse files Browse the repository at this point in the history
  • Loading branch information
f3l1x committed Aug 12, 2019
1 parent e7e003c commit 06cf6b6
Show file tree
Hide file tree
Showing 7 changed files with 79 additions and 141 deletions.
1 change: 1 addition & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
Expand Up @@ -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
112 changes: 20 additions & 92 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -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

Expand Down
28 changes: 28 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -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

6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Expand Down
46 changes: 16 additions & 30 deletions composer.json
Original file line number Diff line number Diff line change
@@ -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",
Expand All @@ -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"
}
}
}
5 changes: 0 additions & 5 deletions phpstan.neon
Original file line number Diff line number Diff line change
@@ -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
22 changes: 11 additions & 11 deletions ruleset.xml
Original file line number Diff line number Diff line change
@@ -1,20 +1,20 @@
<?xml version="1.0"?>
<ruleset name="Markette">
<ruleset>
<!-- Contributte Coding Standard -->
<rule ref="./vendor/ninjify/coding-standard/contributte.xml">
<exclude name="Squiz.Commenting.FunctionComment.InvalidTypeHint"/>
</rule>

<!-- Specific rules -->
<rule ref="SlevomatCodingStandard.Files.TypeNameMatchesFileName">
<properties>
<property name="rootNamespaces" type="array" value="
src=>Contributte\Parsedown,
tests/fixtures=>Tests\Fixtures
"/>
</properties>
</rule>
<rule ref="SlevomatCodingStandard.Files.TypeNameMatchesFileName">
<properties>
<property name="rootNamespaces" type="array" value="
src=>Contributte\Parsedown,
tests/fixtures=>Tests\Fixtures,
"/>
</properties>
</rule>

<!-- Exclude folders -->
<exclude-pattern>/tests/tmp</exclude-pattern>
<!-- Exclude folders -->
<exclude-pattern>/tests/tmp</exclude-pattern>
</ruleset>

0 comments on commit 06cf6b6

Please sign in to comment.