Skip to content

Commit

Permalink
Merge tag 'v3.8.0'
Browse files Browse the repository at this point in the history
v3.8.0

* tag 'v3.8.0':
  Marks 3.8.0
  Update pull-request template
  Update GitHub actions
  Reduce code smells
  Split unit test files
  Bump version number, fix script composer.json handling
  Add development link to README
  Clean composer package meta and contents
  Breakpoint support
  Support slashes and brackets in class names
  Update multi-target image support
  Add REPL using PsySH
  Document DOCTYPE constant addition
  Update changelog
  Add setAlignClasses option
  Bump up dev version
  • Loading branch information
Steffen Schüssler committed Feb 14, 2023
2 parents 4a6a31f + 02ed0cb commit b07d126
Show file tree
Hide file tree
Showing 17 changed files with 650 additions and 347 deletions.
6 changes: 5 additions & 1 deletion .gitattributes
Original file line number Diff line number Diff line change
@@ -1,10 +1,14 @@
/docker export-ignore
/scripts export-ignore
/test export-ignore
/.editorconfig export-ignore
/.github export-ignore
/.gitignore export-ignore
/.travis.yml export-ignore
/Makefile export-ignore
/docker-compose.yml export-ignore
/phpcs.xml export-ignore
/phpstan.neon export-ignore
/phpunit.xml export-ignore
/sonar-project.properties export-ignore
/textile-wordmark.png export-ignore
/.gitattributes export-ignore
5 changes: 2 additions & 3 deletions .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,5 @@
<!--- Put an `x` in all the boxes that apply. -->
- [ ] I documented my additions and changes using PHPdoc.
- [ ] I wrote fixtures to cover my additions.
- [ ] `$ composer update`
- [ ] `$ composer test`
- [ ] `$ composer cs`
- [ ] `$ make clean`
- [ ] `$ make test`
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ jobs:
steps:

- name: Checkout
uses: actions/checkout@v2
uses: actions/checkout@v3
with:
fetch-depth: 0

Expand Down
18 changes: 5 additions & 13 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,25 +13,17 @@ jobs:
steps:

- name: Checkout
uses: actions/checkout@v2
uses: actions/checkout@v3

- name: Changelog
id: changelog
run: |
contents="$(sed -e '1,/h2./d' -e '/h2./,$d' CHANGELOG.textile)"
contents="${contents//'%'/'%25'}"
contents="${contents//$'\n'/'%0A'}"
contents="${contents//$'\r'/'%0D'}"
echo "::set-output name=contents::$contents"
echo "contents<<CHANGELOGEOF" >> $GITHUB_OUTPUT
sed -e '1,/h2./d' -e '/h2./,$d' CHANGELOG.textile >> $GITHUB_OUTPUT
echo "CHANGELOGEOF" >> $GITHUB_OUTPUT
- name: Create Release
id: create_release
uses: actions/create-release@master
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
uses: shogo82148/actions-create-release@v1
with:
tag_name: ${{ github.ref }}
release_name: ${{ github.ref }}
body: ${{ steps.changelog.outputs.contents }}
draft: false
prerelease: false
5 changes: 5 additions & 0 deletions CHANGELOG.textile
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,11 @@ h1. Changelog

Here's a summary of changes in each release. The list doesn't include some small changes or updates to test cases.

h2. "Version 3.8.0 - 2022/12/03":https://github.com/textile/php-textile/releases/tag/v3.8.0

* Added @Parser::setAlignClasses()@ and @Parser::isAlignClassesEnabled()@. This can be used to enable img alignment classes in XHTML output document mode, instead of the default align attribute.
* Added @Parser::DOCTYPE_HTML5@ and @Parser::DOCTYPE_XHTML@ constants. These can be used with @Parser::setDocumentType()@ to specify the output document type.

h2. "Version 3.7.7 - 2022/05/01":https://github.com/textile/php-textile/releases/tag/v3.7.7

* Fix deprecation errors that appear on PHP >= 8.1 about preg_split limit argument's NULL value.
Expand Down
24 changes: 21 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
.PHONY: all clean help lint lint-fix test test-static test-unit bump bump-dev process-reports
.PHONY: all clean docker-build docker-images help lint lint-fix repl test test-static test-unit bump bump-dev process-reports

IMAGE?=php_8_1
PHP = docker-compose run --rm $(IMAGE)
PHP = docker-compose run --rm php

all: test

Expand All @@ -26,6 +26,9 @@ test-static: vendor
test-unit: vendor
$(PHP) composer test:unit

repl: vendor
$(PHP) composer repl

bump: vendor
$(PHP) composer bump

Expand All @@ -35,6 +38,12 @@ bump-dev: vendor
process-reports:
$(PHP) bash -c "test -e build/logs/clover.xml && sed -i 's/\/app\///' build/logs/clover.xml"

docker-build:
docker-compose build php

docker-images:
@$(PHP) bash -c "cd docker/image && ls ."

help:
@echo "Manage project"
@echo ""
Expand All @@ -60,6 +69,9 @@ help:
@echo " $$ make test-static"
@echo " Run static tests"
@echo ""
@echo " $$ make repl"
@echo " Launch read-print-eval loop"
@echo ""
@echo " $$ make bump"
@echo " Bump version"
@echo ""
Expand All @@ -75,8 +87,14 @@ help:
@echo " $$ make process-reports"
@echo " Formats test reports to use relative local file paths"
@echo ""
@echo " $$ make docker-images"
@echo " Lists available Docker images"
@echo ""
@echo " $$ make docker-build"
@echo " Re-builds the Docker image"
@echo ""
@echo "Environment variables:"
@echo ""
@echo " IMAGE"
@echo " docker-compose service name that is used to run the command"
@echo " Docker image that is used to run the command"
@echo ""
4 changes: 4 additions & 0 deletions README.textile
Original file line number Diff line number Diff line change
Expand Up @@ -77,3 +77,7 @@ $parser
h2. Getting in contact

The PHP-Textile project welcomes constructive input and bug reports from users. Please "open an issue":https://github.com/textile/php-textile/issues on the repository for a comment, feature request or bug.

h2. Development

See "CONTRIBUTING.textile":https://github.com/textile/php-textile/blob/master/.github/CONTRIBUTING.textile.
7 changes: 4 additions & 3 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
"homepage": "https://github.com/textile/php-textile",
"keywords": ["php-textile", "textile", "parser", "markup", "language", "html", "format", "plaintext", "document"],
"support": {
"irc": "irc://irc.freenode.net/textile",
"wiki": "https://github.com/textile/php-textile/wiki",
"issues": "https://github.com/textile/php-textile/issues",
"source": "https://github.com/textile/php-textile"
Expand All @@ -27,11 +26,12 @@
"phpstan/phpstan": "1.6.3",
"phpunit/phpunit": "^9.5.20",
"squizlabs/php_codesniffer": "3.*",
"symfony/yaml": "^4.4.3"
"symfony/yaml": "^4.4.3",
"psy/psysh": "^0.11.2"
},
"extra": {
"branch-alias": {
"dev-master": "3.7-dev"
"dev-master": "3.8-dev"
}
},
"scripts": {
Expand All @@ -44,6 +44,7 @@
"bump-dev": "@php ./scripts/release.php --dev",
"lint": "phpcs",
"lint-fix": "phpcbf",
"repl": "psysh",
"test:static": "phpstan analyse --level 8 src",
"test:unit": "XDEBUG_MODE=coverage phpunit"
}
Expand Down
9 changes: 7 additions & 2 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -1,13 +1,18 @@
version: '3'

services:
php_8_1:
build: ./docker/image/php/8_1
php:
build: ./docker/image/${IMAGE:-php_8_1}
volumes:
- .:/app
- ${COMPOSER_HOME:-$HOME/.composer}:/tmp
networks:
- app
environment:
- XDEBUG_CONFIG
- XDEBUG_MODE
- XDEBUG_TRIGGER
- PHP_IDE_CONFIG

networks:
app:
Expand Down
File renamed without changes.
4 changes: 2 additions & 2 deletions scripts/release.php
Original file line number Diff line number Diff line change
Expand Up @@ -72,8 +72,8 @@
},
],
'composer.json' => [
'/("dev-master": ")([^"])(")/' => function ($m) use ($dev) {
return $m[1] . $dev . $m[2];
'/("dev-master": ")([^"]+)(")/' => function ($m) use ($dev) {
return $m[1] . $dev . $m[3];
}
]
];
Expand Down
Loading

0 comments on commit b07d126

Please sign in to comment.