Skip to content

Commit d005770

Browse files
authored
Merge pull request #6 from alleyinteractive/feature/next
Repo updates and maintenance
2 parents 2d536b9 + 8465946 commit d005770

File tree

8 files changed

+106
-67
lines changed

8 files changed

+106
-67
lines changed

.editorconfig

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -5,14 +5,9 @@ charset = utf-8
55
end_of_line = lf
66
trim_trailing_whitespace = true
77
insert_final_newline = true
8-
indent_style = tab
9-
indent_size = 4
10-
11-
[*.{ts,tsx,js,jsx,scss,css,json,yaml,yml,feature,xml}]
128
indent_style = space
139
indent_size = 2
1410

15-
# Dotfiles
16-
[.*]
17-
indent_style = space
18-
indent_size = 2
11+
[*.{html,php}]
12+
indent_size = 4
13+
indent_style = tab

.gitattributes

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,11 +7,10 @@
77
#
88
/.github export-ignore
99
/.phpcs export-ignore
10-
/phpcs.xml export-ignore
10+
/.phpcs.xml export-ignore
11+
/phpstan.neon export-ignore
1112
/phpunit.xml export-ignore
1213
/tests export-ignore
13-
/configure.php export-ignore
14-
/Makefile export-ignore
1514

1615
#
1716
# 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-quality.yml

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

.github/workflows/coding-standards.yml

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

phpcs.xml renamed to .phpcs.xml

Lines changed: 12 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -2,42 +2,37 @@
22
<ruleset xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" name="alleyinteractive/wp-block-audit-command" xsi:noNamespaceSchemaLocation="https://raw.githubusercontent.com/squizlabs/PHP_CodeSniffer/master/phpcs.xsd">
33
<description>PHP_CodeSniffer standard for alleyinteractive/wp-block-audit-command.</description>
44

5-
<file>src/</file>
6-
<file>tests/</file>
7-
<exclude-pattern>vendor/</exclude-pattern>
8-
95
<!-- Include Alley Rules -->
10-
<rule ref="Alley-Interactive" />
6+
<rule ref="Alley-Interactive"/>
117

128
<!--
139
Pass some flags to PHPCS:
1410
p flag: Show progress of the run.
1511
s flag: Show sniff codes in all reports.
16-
n flag: Do not print warnings.
1712
-->
18-
<arg value="ps" />
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="./"/>
1921

2022
<!-- Check up to 20 files simultaneously. -->
21-
<arg name="parallel" value="20" />
23+
<arg name="parallel" value="20"/>
2224

2325
<!-- Set severity to 1 to see everything that isn't effectively turned off. -->
24-
<arg name="severity" value="1" />
26+
<arg name="severity" value="1"/>
2527

2628
<!-- In effect, set the minimum supported version of WordPress to the latest version. -->
2729
<config name="minimum_supported_wp_version" value="99.0"/>
2830

29-
<!-- Set the allowed text domains for i18n. -->
30-
<rule ref="WordPress.WP.I18n">
31-
<properties>
32-
<property name="text_domain" type="array" value="alley"/>
33-
</properties>
34-
</rule>
35-
3631
<!-- Define the prefixes that can be used by the plugin -->
3732
<rule ref="WordPress.NamingConventions.PrefixAllGlobals">
3833
<properties>
3934
<property name="prefixes" type="array">
40-
<element value="Alley" />
35+
<element value="alley"/>
4136
</property>
4237
</properties>
4338
</rule>

CHANGELOG.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,16 @@
22

33
This library adheres to [Semantic Versioning](https://semver.org/) and [Keep a CHANGELOG](https://keepachangelog.com/en/1.0.0/).
44

5+
## Unreleased
6+
7+
Nothing yet.
8+
9+
## 2.0.0
10+
11+
### Changed
12+
13+
- The minimum PHP version is now 8.2.
14+
515
## 1.2.0
616

717
### Changed

composer.json

Lines changed: 34 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,53 +1,74 @@
11
{
22
"name": "alleyinteractive/wp-block-audit-command",
33
"description": "Audit WordPress block usage in post content.",
4-
"type": "wp-cli-package",
5-
"homepage": "https://github.com/alleyinteractive/wp-block-audit-command",
64
"license": "GPL-2.0-or-later",
5+
"type": "wp-cli-package",
76
"authors": [
87
{
98
"name": "Alley",
109
"email": "[email protected]"
1110
}
1211
],
12+
"homepage": "https://github.com/alleyinteractive/wp-block-audit-command",
1313
"require": {
14-
"php": "^8.1",
14+
"php": "^8.2",
1515
"alleyinteractive/composer-wordpress-autoloader": "^1.0",
1616
"alleyinteractive/wp-bulk-task": "^0.2",
1717
"alleyinteractive/wp-match-blocks": "^3.0",
1818
"alleyinteractive/wp-type-extensions": "^2.1"
1919
},
2020
"require-dev": {
2121
"alleyinteractive/alley-coding-standards": "^2.0",
22-
"szepeviktor/phpstan-wordpress": "^1.1",
22+
"ergebnis/composer-normalize": "^2.44",
23+
"mantle-framework/testkit": "^1.2",
24+
"phpstan/phpstan": "^1.12",
25+
"szepeviktor/phpstan-wordpress": "^1.3",
2326
"wp-cli/entity-command": "^2.6",
2427
"wp-cli/wp-cli": "^2.10"
2528
},
29+
"minimum-stability": "dev",
30+
"prefer-stable": true,
31+
"autoload": {
32+
"files": [
33+
"command.php"
34+
]
35+
},
2636
"config": {
2737
"allow-plugins": {
2838
"alleyinteractive/composer-wordpress-autoloader": true,
2939
"dealerdirect/phpcodesniffer-composer-installer": true,
40+
"ergebnis/composer-normalize": true,
3041
"pestphp/pest-plugin": true
3142
},
43+
"lock": false,
3244
"sort-packages": true
3345
},
34-
"autoload": {
35-
"files": [
36-
"command.php"
37-
]
38-
},
3946
"extra": {
47+
"composer-normalize": {
48+
"indent-size": 2,
49+
"indent-style": "space"
50+
},
4051
"wordpress-autoloader": {
4152
"autoload": {
4253
"Alley\\WP": "src"
4354
}
4455
}
4556
},
46-
"minimum-stability": "dev",
47-
"prefer-stable": true,
4857
"scripts": {
58+
"pre-install-cmd": [
59+
"@tidy"
60+
],
61+
"post-install-cmd": [
62+
"@tidy"
63+
],
4964
"phpcbf": "phpcbf .",
5065
"phpcs": "phpcs .",
51-
"phpstan": "phpstan --memory-limit=512M"
66+
"phpstan": "phpstan -v --memory-limit=512M",
67+
"test": [
68+
"@phpcs",
69+
"@phpstan",
70+
"@phpunit"
71+
],
72+
"tidy": "[ $COMPOSER_DEV_MODE -eq 0 ] || composer normalize"
5273
}
53-
}
74+
}

0 commit comments

Comments
 (0)