Skip to content

Commit

Permalink
Repo updates and maintenance
Browse files Browse the repository at this point in the history
  • Loading branch information
dlh01 committed Nov 1, 2024
1 parent 2d536b9 commit 8465946
Show file tree
Hide file tree
Showing 8 changed files with 106 additions and 67 deletions.
11 changes: 3 additions & 8 deletions .editorconfig
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,9 @@ charset = utf-8
end_of_line = lf
trim_trailing_whitespace = true
insert_final_newline = true
indent_style = tab
indent_size = 4

[*.{ts,tsx,js,jsx,scss,css,json,yaml,yml,feature,xml}]
indent_style = space
indent_size = 2

# Dotfiles
[.*]
indent_style = space
indent_size = 2
[*.{html,php}]
indent_size = 4
indent_style = tab
5 changes: 2 additions & 3 deletions .gitattributes
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,10 @@
#
/.github export-ignore
/.phpcs export-ignore
/phpcs.xml export-ignore
/.phpcs.xml export-ignore
/phpstan.neon export-ignore
/phpunit.xml export-ignore
/tests export-ignore
/configure.php export-ignore
/Makefile export-ignore

#
# Auto detect text files and perform LF normalization.
Expand Down
45 changes: 45 additions & 0 deletions .github/workflows/all-pr-tests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
name: "All Pull Request Tests"

on:
pull_request:
branches:
- main
types: [opened, synchronize, reopened, ready_for_review]

jobs:
# We use a single job to ensure that all steps run in the same environment and
# reduce the number of minutes used.
pr-tests:
# Don't run on draft PRs
if: github.event.pull_request.draft == false
# Timeout after 10 minutes
timeout-minutes: 10
# Define a matrix of PHP/WordPress versions to test against
strategy:
matrix:
php: [8.2, 8.3]
wordpress: ["latest"]
multisite: [false]
runs-on: ubuntu-latest
# Cancel any existing runs of this workflow
concurrency:
group: ${{ github.workflow }}-${{ github.event_name }}-${{ github.event.pull_request.number || github.ref }}-P${{ matrix.php }}-WP${{ matrix.wordpress }}-MS${{ matrix.multisite }}
cancel-in-progress: true
# Name the job in the matrix
name: "PR Tests PHP ${{ matrix.php }} WordPress ${{ matrix.wordpress }} multisite ${{ matrix.multisite }}"
steps:
- uses: actions/checkout@v4

- name: Run General Tests
# See https://github.com/alleyinteractive/action-test-general for more options
uses: alleyinteractive/action-test-general@develop

- name: Run PHP Tests
# See https://github.com/alleyinteractive/action-test-php for more options
uses: alleyinteractive/action-test-php@develop
with:
php-version: '${{ matrix.php }}'
audit-command: 'composer audit --no-dev --ansi --no-interaction'
wordpress-version: '${{ matrix.wordpress }}'
wordpress-multisite: '${{ matrix.multisite }}'
skip-wordpress-install: 'true'
13 changes: 0 additions & 13 deletions .github/workflows/coding-quality.yml

This file was deleted.

13 changes: 0 additions & 13 deletions .github/workflows/coding-standards.yml

This file was deleted.

29 changes: 12 additions & 17 deletions phpcs.xml → .phpcs.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2,42 +2,37 @@
<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">
<description>PHP_CodeSniffer standard for alleyinteractive/wp-block-audit-command.</description>

<file>src/</file>
<file>tests/</file>
<exclude-pattern>vendor/</exclude-pattern>

<!-- Include Alley Rules -->
<rule ref="Alley-Interactive" />
<rule ref="Alley-Interactive"/>

<!--
Pass some flags to PHPCS:
p flag: Show progress of the run.
s flag: Show sniff codes in all reports.
n flag: Do not print warnings.
-->
<arg value="ps" />
<arg value="ps"/>

<file>src/</file>
<file>tests/</file>
<exclude-pattern>vendor/</exclude-pattern>

<!-- Strip the filepaths down to the relevant bit. -->
<arg name="basepath" value="./"/>

<!-- Check up to 20 files simultaneously. -->
<arg name="parallel" value="20" />
<arg name="parallel" value="20"/>

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

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

<!-- Set the allowed text domains for i18n. -->
<rule ref="WordPress.WP.I18n">
<properties>
<property name="text_domain" type="array" value="alley"/>
</properties>
</rule>

<!-- Define the prefixes that can be used by the plugin -->
<rule ref="WordPress.NamingConventions.PrefixAllGlobals">
<properties>
<property name="prefixes" type="array">
<element value="Alley" />
<element value="alley"/>
</property>
</properties>
</rule>
Expand Down
10 changes: 10 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,16 @@

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

## Unreleased

Nothing yet.

## 2.0.0

### Changed

- The minimum PHP version is now 8.2.

## 1.2.0

### Changed
Expand Down
47 changes: 34 additions & 13 deletions composer.json
Original file line number Diff line number Diff line change
@@ -1,53 +1,74 @@
{
"name": "alleyinteractive/wp-block-audit-command",
"description": "Audit WordPress block usage in post content.",
"type": "wp-cli-package",
"homepage": "https://github.com/alleyinteractive/wp-block-audit-command",
"license": "GPL-2.0-or-later",
"type": "wp-cli-package",
"authors": [
{
"name": "Alley",
"email": "[email protected]"
}
],
"homepage": "https://github.com/alleyinteractive/wp-block-audit-command",
"require": {
"php": "^8.1",
"php": "^8.2",
"alleyinteractive/composer-wordpress-autoloader": "^1.0",
"alleyinteractive/wp-bulk-task": "^0.2",
"alleyinteractive/wp-match-blocks": "^3.0",
"alleyinteractive/wp-type-extensions": "^2.1"
},
"require-dev": {
"alleyinteractive/alley-coding-standards": "^2.0",
"szepeviktor/phpstan-wordpress": "^1.1",
"ergebnis/composer-normalize": "^2.44",
"mantle-framework/testkit": "^1.2",
"phpstan/phpstan": "^1.12",
"szepeviktor/phpstan-wordpress": "^1.3",
"wp-cli/entity-command": "^2.6",
"wp-cli/wp-cli": "^2.10"
},
"minimum-stability": "dev",
"prefer-stable": true,
"autoload": {
"files": [
"command.php"
]
},
"config": {
"allow-plugins": {
"alleyinteractive/composer-wordpress-autoloader": true,
"dealerdirect/phpcodesniffer-composer-installer": true,
"ergebnis/composer-normalize": true,
"pestphp/pest-plugin": true
},
"lock": false,
"sort-packages": true
},
"autoload": {
"files": [
"command.php"
]
},
"extra": {
"composer-normalize": {
"indent-size": 2,
"indent-style": "space"
},
"wordpress-autoloader": {
"autoload": {
"Alley\\WP": "src"
}
}
},
"minimum-stability": "dev",
"prefer-stable": true,
"scripts": {
"pre-install-cmd": [
"@tidy"
],
"post-install-cmd": [
"@tidy"
],
"phpcbf": "phpcbf .",
"phpcs": "phpcs .",
"phpstan": "phpstan --memory-limit=512M"
"phpstan": "phpstan -v --memory-limit=512M",
"test": [
"@phpcs",
"@phpstan",
"@phpunit"
],
"tidy": "[ $COMPOSER_DEV_MODE -eq 0 ] || composer normalize"
}
}
}

0 comments on commit 8465946

Please sign in to comment.