Skip to content

arraystory/action-wpcs

Use this GitHub action with your project
Add this Action to an existing workflow or create a new one
View on Marketplace

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 

Repository files navigation

WPCS Checker

A reusable GitHub Action to run PHPCS with WordPress Coding Standards on your plugins and themes.

Usage

name: WPCS

on:
  push:
    branches: [master, develop]
  pull_request:
    branches: [master, develop]

jobs:
  phpcs:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v4
      - uses: arraystory/action-wpcs@v1
        with:
          text_domain: 'my-plugin'

Inputs

Input Required Default Description
text_domain Yes - Plugin/theme text domain
php_version No 8.2 PHP version to use
minimum_php No 7.4 Minimum PHP version for compatibility checks
prefixes No - Function/class prefixes (comma-separated)
paths No . Paths to scan
ignore No vendor,node_modules,assets Paths to ignore

Examples

Basic usage

- uses: arraystory/action-wpcs@v1
  with:
    text_domain: 'my-plugin'

With prefixes

- uses: arraystory/action-wpcs@v1
  with:
    text_domain: 'my-plugin'
    prefixes: 'myplugin_,MyPlugin_'

Custom PHP version and paths

- uses: arraystory/action-wpcs@v1
  with:
    text_domain: 'my-plugin'
    php_version: '8.1'
    minimum_php: '7.4'
    paths: 'includes src'
    ignore: 'vendor,node_modules,assets,tests'

Full example workflow

name: Code Quality

on:
  push:
    branches: [master, develop]
  pull_request:
    branches: [master, develop]

jobs:
  phpcs:
    name: WordPress Coding Standards
    runs-on: ubuntu-latest
    steps:
      - name: Checkout
        uses: actions/checkout@v4

      - name: Run PHPCS
        uses: arraystory/action-wpcs@v1
        with:
          text_domain: 'my-plugin'
          prefixes: 'myplugin_'
          minimum_php: '7.4'

What's included

  • PHPCS - PHP CodeSniffer
  • WPCS 3.0 - WordPress Coding Standards
  • PHPCompatibilityWP - PHP version compatibility checks

License

MIT

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Packages

No packages published