Skip to content

Commit

Permalink
Add linter for sniffs (#790)
Browse files Browse the repository at this point in the history
  • Loading branch information
ernilambar authored Nov 26, 2024
1 parent 27b111b commit 16e2b61
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 1 deletion.
29 changes: 29 additions & 0 deletions .github/workflows/php-lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -61,3 +61,32 @@ jobs:

- name: PHPMD
run: composer phpmd

php-lint-sniffs:
name: PHP (Sniffs)
runs-on: ubuntu-latest
timeout-minutes: 20
steps:
- uses: actions/checkout@v4

- uses: shivammathur/setup-php@v2
with:
php-version: '8.0'

- name: Validate Composer configuration
working-directory: "phpcs-sniffs"
run: composer validate

- name: Install PHP dependencies
uses: ramsey/composer-install@57532f8be5bda426838819c5ee9afb8af389d51a
with:
composer-options: '--prefer-dist'
working-directory: "phpcs-sniffs"

- name: PHP Lint
working-directory: "phpcs-sniffs"
run: composer lint

- name: PHP Lint PHPCS
working-directory: "phpcs-sniffs"
run: composer check-cs
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ public function process_token( $stackPtr ) {
'Do not use Localhost/127.0.0.1 in your code. Found: %s',
$this->find_token_in_multiline_string( $stackPtr, $content, $match[1] ),
'Found',
[ $match[0] ]
array( $match[0] )
);
}
}
Expand Down

0 comments on commit 16e2b61

Please sign in to comment.