php-cs-fixer-action icon indicating copy to clipboard operation
php-cs-fixer-action copied to clipboard

Action to fix PHP Coding Standards

PHP Coding Standards Fixer Action

License: MIT

A github action to fix PHP Coding Standards using php-cs-fixer.

Requirements

  • Be sure to have set the following before using the action
    - uses: actions/checkout@v2
    

Setup

  • Include the following in your action:
    - name: php-cs-fixer
      uses: ale94lko/[email protected]
    

Parameters

Name Description Required Default Values
php-cs-fixer-version Version of php-cs-fixer to download false v3.9.4 vX.X.X
rules-version Version of rules to check from php-cs-fixer-rules false v1.0.1 vX.X.X
use-full-rules Whether to use the full rules package or the minimal one false true true OR false

Examples

Simple use with default parameters

name: Fix code styles
on: [pull_request]
jobs:
  build:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v2

      - name: PHP Code Style
        uses: ale94lko/[email protected]

Simple use with php-cs-fixer-version

  - name: PHP Code Style
    uses: ale94lko/[email protected]
+   with:
+     php-cs-fixer-version: v3.9.4

Simple use with rules-version

  - name: PHP Code Style
    uses: ale94lko/[email protected]
+   with:
+     rules-version: v1.0.1

Simple use with use-full-rules

  - name: PHP Code Style
    uses: ale94lko/[email protected]
+   with:
+     use-full-rules: true

View live

Contributing

Please read through our contributing guidelines.

License

php-cs-fixer-action is an open source project that is licensed under MIT.