Skip to content

Commit 217009c

Browse files
committed
Repo updates and maintenance
1 parent 1fa48dc commit 217009c

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

45 files changed

+571
-395
lines changed

.editorconfig

Lines changed: 4 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,13 @@
1-
# EditorConfig helps maintain consistent coding styles for developers working on the same project across various editors and IDEs.
2-
# See https://editorconfig.org.
3-
41
root = true
52

63
[*]
74
charset = utf-8
85
end_of_line = lf
9-
indent_size = 2
10-
indent_style = space
11-
insert_final_newline = true
126
trim_trailing_whitespace = true
7+
insert_final_newline = true
8+
indent_style = space
9+
indent_size = 2
1310

14-
[*.php]
11+
[*.{html,php}]
1512
indent_size = 4
1613
indent_style = tab
17-
18-
[*.xml]
19-
indent_size = 4

.gitattributes

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,15 +2,16 @@
22
# Exclude these files from release archives.
33
#
44
# This will also make the files unavailable when using Composer with `--prefer-dist`.
5-
# If you develop using Composer, use `--prefer-source`.
65
#
76
# Via WPCS.
87
#
98
/.github export-ignore
10-
/.php-cs-fixer.dist.php export-ignore
11-
/phpcs.xml export-ignore
9+
/.phpcs.xml export-ignore
10+
/.phpcs export-ignore
1211
/phpunit.xml export-ignore
1312
/tests export-ignore
13+
/configure.php export-ignore
14+
/Makefile export-ignore
1415

1516
#
1617
# Auto detect text files and perform LF normalization.

.github/workflows/all-pr-tests.yml

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
name: "All Pull Request Tests"
2+
3+
on:
4+
pull_request:
5+
branches:
6+
- main
7+
types: [opened, synchronize, reopened, ready_for_review]
8+
9+
jobs:
10+
# We use a single job to ensure that all steps run in the same environment and
11+
# reduce the number of minutes used.
12+
pr-tests:
13+
# Don't run on draft PRs
14+
if: github.event.pull_request.draft == false
15+
# Timeout after 10 minutes
16+
timeout-minutes: 10
17+
# Define a matrix of PHP/WordPress versions to test against
18+
strategy:
19+
matrix:
20+
php: [8.2, 8.3]
21+
wordpress: ["latest"]
22+
multisite: [false]
23+
runs-on: ubuntu-latest
24+
# Cancel any existing runs of this workflow
25+
concurrency:
26+
group: ${{ github.workflow }}-${{ github.event_name }}-${{ github.event.pull_request.number || github.ref }}-P${{ matrix.php }}-WP${{ matrix.wordpress }}-MS${{ matrix.multisite }}
27+
cancel-in-progress: true
28+
# Name the job in the matrix
29+
name: "PR Tests PHP ${{ matrix.php }} WordPress ${{ matrix.wordpress }} multisite ${{ matrix.multisite }}"
30+
steps:
31+
- uses: actions/checkout@v4
32+
33+
- name: Run General Tests
34+
# See https://github.com/alleyinteractive/action-test-general for more options
35+
uses: alleyinteractive/action-test-general@develop
36+
37+
- name: Run PHP Tests
38+
# See https://github.com/alleyinteractive/action-test-php for more options
39+
uses: alleyinteractive/action-test-php@develop
40+
with:
41+
php-version: '${{ matrix.php }}'
42+
audit-command: 'composer audit --no-dev --ansi --no-interaction'
43+
wordpress-version: '${{ matrix.wordpress }}'
44+
wordpress-multisite: '${{ matrix.multisite }}'
45+
skip-wordpress-install: 'true'

.github/workflows/coding-standards.yml

Lines changed: 0 additions & 12 deletions
This file was deleted.

.github/workflows/unit-test.yml

Lines changed: 0 additions & 21 deletions
This file was deleted.

.php-cs-fixer.dist.php

Lines changed: 0 additions & 36 deletions
This file was deleted.

.phpcs.xml

Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
<?xml version="1.0"?>
2+
<ruleset xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" name="alleyinteractive/wp-match-blocks" xsi:noNamespaceSchemaLocation="https://raw.githubusercontent.com/squizlabs/PHP_CodeSniffer/master/phpcs.xsd">
3+
<description>PHP_CodeSniffer standard for alleyinteractive/wp-match-blocks.</description>
4+
5+
<!-- Include Alley Rules -->
6+
<rule ref="Alley-Interactive"/>
7+
8+
<!--
9+
Pass some flags to PHPCS:
10+
p flag: Show progress of the run.
11+
s flag: Show sniff codes in all reports.
12+
-->
13+
<arg value="ps"/>
14+
15+
<file>src/</file>
16+
<file>tests/</file>
17+
<exclude-pattern>vendor/</exclude-pattern>
18+
19+
<!-- Strip the filepaths down to the relevant bit. -->
20+
<arg name="basepath" value="./"/>
21+
22+
<!-- Check up to 20 files simultaneously. -->
23+
<arg name="parallel" value="20"/>
24+
25+
<!-- Set severity to 1 to see everything that isn't effectively turned off. -->
26+
<arg name="severity" value="1"/>
27+
28+
<!-- In effect, set the minimum supported version of WordPress to the latest version. -->
29+
<config name="minimum_supported_wp_version" value="99.0"/>
30+
31+
<!-- Define the prefixes that can be used by the plugin -->
32+
<rule ref="WordPress.NamingConventions.PrefixAllGlobals">
33+
<properties>
34+
<property name="prefixes" type="array">
35+
<element value="alley"/>
36+
</property>
37+
</properties>
38+
</rule>
39+
40+
<!-- Allow snake case properties from WP_Block_Parser_Block and Laminas Validator. -->
41+
<rule ref="WordPress.NamingConventions.ValidVariableName">
42+
<properties>
43+
<property name="allowed_custom_properties" type="array">
44+
<element value="blockName"/>
45+
<element value="innerBlocks"/>
46+
<element value="innerHTML"/>
47+
<element value="messageTemplates"/>
48+
<element value="messageVariables"/>
49+
</property>
50+
</properties>
51+
</rule>
52+
53+
<rule ref="WordPress.Files.FileName">
54+
<exclude-pattern>tests/*</exclude-pattern>
55+
</rule>
56+
</ruleset>

CHANGELOG.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,12 @@ This library adheres to [Semantic Versioning](https://semver.org/) and [Keep a C
66

77
Nothing yet.
88

9+
## 4.0.0
10+
11+
### Changed
12+
13+
- The minimum PHP version is now 8.2.
14+
915
## 3.1.0
1016

1117
### Changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ Additionally:
2929
Install the latest version with:
3030

3131
```bash
32-
$ composer require alleyinteractive/wp-match-blocks
32+
composer require alleyinteractive/wp-match-blocks
3333
```
3434

3535
## Basic usage

composer.json

Lines changed: 47 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -1,51 +1,72 @@
11
{
22
"name": "alleyinteractive/wp-match-blocks",
33
"description": "Match WordPress blocks in the given content.",
4-
"type": "library",
54
"license": "GPL-2.0-or-later",
5+
"type": "library",
66
"authors": [
77
{
88
"name": "Alley",
99
"email": "[email protected]"
1010
}
1111
],
12+
"require": {
13+
"php": "^8.2",
14+
"alleyinteractive/composer-wordpress-autoloader": "^1.0.0",
15+
"alleyinteractive/laminas-validator-extensions": "^2.0.0"
16+
},
17+
"require-dev": {
18+
"alleyinteractive/alley-coding-standards": "^2.0",
19+
"ergebnis/composer-normalize": "^2.44",
20+
"mantle-framework/testkit": "^1.2",
21+
"szepeviktor/phpstan-wordpress": "^1.3"
22+
},
23+
"minimum-stability": "dev",
24+
"prefer-stable": true,
1225
"autoload": {
1326
"files": [
14-
"src/alley/wp/match-blocks.php",
15-
"src/alley/wp/internals/internals.php"
27+
"src/match-blocks.php",
28+
"src/internals/internals.php"
1629
]
1730
},
31+
"autoload-dev": {
32+
"Alley\\WP\\Tests": "tests/"
33+
},
1834
"config": {
1935
"allow-plugins": {
2036
"alleyinteractive/composer-wordpress-autoloader": true,
21-
"dealerdirect/phpcodesniffer-composer-installer": true
37+
"dealerdirect/phpcodesniffer-composer-installer": true,
38+
"ergebnis/composer-normalize": true
2239
},
23-
"lock": false
24-
},
25-
"require": {
26-
"php": "^8.0",
27-
"alleyinteractive/composer-wordpress-autoloader": "^1.0.0",
28-
"alleyinteractive/laminas-validator-extensions": "^2.0.0"
29-
},
30-
"require-dev": {
31-
"alleyinteractive/alley-coding-standards": "^1.0.0",
32-
"friendsofphp/php-cs-fixer": "^3.8",
33-
"mantle-framework/testkit": "^0.9"
34-
},
35-
"scripts": {
36-
"fixer": "php-cs-fixer -v fix --allow-risky=yes",
37-
"phpcbf": "phpcbf",
38-
"phpcs": "phpcs",
39-
"phpunit": "phpunit"
40+
"lock": false,
41+
"sort-packages": true
4042
},
4143
"extra": {
44+
"composer-normalize": {
45+
"indent-size": 2,
46+
"indent-style": "space"
47+
},
4248
"wordpress-autoloader": {
4349
"autoload": {
44-
"Alley\\": "src/alley/"
45-
},
46-
"autoload-dev": {
47-
"Alley\\": "tests/alley/"
50+
"Alley\\WP\\": "src/"
4851
}
4952
}
53+
},
54+
"scripts": {
55+
"pre-install-cmd": [
56+
"@tidy"
57+
],
58+
"post-install-cmd": [
59+
"@tidy"
60+
],
61+
"phpcbf": "phpcbf",
62+
"phpcs": "phpcs",
63+
"phpstan": "phpstan -v --memory-limit=512M",
64+
"phpunit": "phpunit",
65+
"test": [
66+
"@phpcs",
67+
"@phpstan",
68+
"@phpunit"
69+
],
70+
"tidy": "[ $COMPOSER_DEV_MODE -eq 0 ] || composer normalize"
5071
}
51-
}
72+
}

0 commit comments

Comments
 (0)