Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions .eslintignore
Original file line number Diff line number Diff line change
Expand Up @@ -9,3 +9,9 @@ cypress
node_modules
vendor
google-fonts.js

# Bundled third-party frontend libraries.
src/js/frontend/idle-timer.js
src/js/frontend/jquery.blockUI.js
src/js/frontend/jquery.waypoints.js
src/js/frontend/jsuri.js
63 changes: 63 additions & 0 deletions .github/workflows/code-quality.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
name: Code Quality

on:
pull_request:
branches: [main]
push:
branches: [main]
workflow_dispatch:

concurrency:
group: code-quality-${{ github.ref }}
cancel-in-progress: true

permissions:
contents: read

jobs:
eslint:
name: ESLint
runs-on: ubuntu-latest

steps:
- name: Checkout code
uses: actions/checkout@v6
Comment thread
superdav42 marked this conversation as resolved.
Resolved
with:
persist-credentials: false

- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: 22
cache: npm

- name: Install dependencies
run: npm ci

- name: Run ESLint
run: npm run lint:js

php-quality:
name: PHPCS + PHPStan
runs-on: ubuntu-latest

steps:
- name: Checkout code
uses: actions/checkout@v6
with:
persist-credentials: false

- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: '8.2'
tools: composer:v2

- name: Install dependencies
run: composer install --prefer-dist --no-progress

- name: Run PHPCS
run: composer phpcs

- name: Run PHPStan
run: composer phpstan -- --error-format=github
28 changes: 27 additions & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,19 +3,45 @@
"description": "Post comments without a reload.",
"type": "project",
"license": "GPL",
"require": {
"php": ">=7.2"
},
"require-dev": {
"dealerdirect/phpcodesniffer-composer-installer": "^1.0",
"phpcompatibility/phpcompatibility-wp": "^2.1",
"php-stubs/wordpress-stubs": "^6.5",
"phpstan/phpstan": "^2.0",
"squizlabs/php_codesniffer": "^3.7",
"szepeviktor/phpstan-wordpress": "^2.0",
"wp-coding-standards/wpcs": "^3.0"
},
"authors": [
{
"name": "Ronald Huereca",
"email": "ronald@dlxplugins.com"
}
],
"minimum-stability": "dev",
"prefer-stable": true,
"config": {
"allow-plugins": {
"dealerdirect/phpcodesniffer-composer-installer": true
},
"sort-packages": true,
"vendor-dir": "lib"
},
"autoload": {
"autoload": {
"psr-4": {
"DLXPlugins\\WPAC\\": "php/"
}
},
"scripts": {
"phpcs": "phpcs",
"phpcbf": "phpcbf",
"phpstan": "phpstan analyse --memory-limit=1G",
"lint": [
"@phpcs",
"@phpstan"
]
}
}
Loading
Loading