mirror of
https://github.com/TheAlgorithms/PHP.git
synced 2025-07-09 11:13:50 +02:00
add cs checking to ci flow
This commit is contained in:
25
.github/workflows/code-style.yml
vendored
Normal file
25
.github/workflows/code-style.yml
vendored
Normal file
@ -0,0 +1,25 @@
|
|||||||
|
name: Code style
|
||||||
|
|
||||||
|
on: [push, pull_request]
|
||||||
|
|
||||||
|
permissions:
|
||||||
|
contents: read
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
phpcs:
|
||||||
|
name: PHPCS
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
- name: Checkout
|
||||||
|
uses: actions/checkout@v3
|
||||||
|
|
||||||
|
- name: Setup PHP
|
||||||
|
uses: shivammathur/setup-php@v2
|
||||||
|
with:
|
||||||
|
php-version: '7.4'
|
||||||
|
|
||||||
|
- name: Install dependencies
|
||||||
|
run: composer update --prefer-dist --no-progress --no-suggest
|
||||||
|
|
||||||
|
- name: Run script
|
||||||
|
run: vendor/bin/phpcs
|
3
.gitignore
vendored
3
.gitignore
vendored
@ -4,4 +4,7 @@
|
|||||||
.phan
|
.phan
|
||||||
composer.lock
|
composer.lock
|
||||||
|
|
||||||
|
/.phpcs-cache
|
||||||
|
/phpcs.xml
|
||||||
|
|
||||||
.phpunit.result.cache
|
.phpunit.result.cache
|
@ -12,7 +12,8 @@
|
|||||||
"phan/phan": "^2.7"
|
"phan/phan": "^2.7"
|
||||||
},
|
},
|
||||||
"require-dev": {
|
"require-dev": {
|
||||||
"phpunit/phpunit": "^9"
|
"phpunit/phpunit": "^9",
|
||||||
|
"squizlabs/php_codesniffer": "^3.7"
|
||||||
},
|
},
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"test": "vendor/bin/phpunit tests"
|
"test": "vendor/bin/phpunit tests"
|
||||||
|
9
phpcs.xml.dist
Normal file
9
phpcs.xml.dist
Normal file
@ -0,0 +1,9 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<ruleset xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||||
|
xsi:noNamespaceSchemaLocation="vendor/squizlabs/php_codesniffer/phpcs.xsd">
|
||||||
|
|
||||||
|
<arg name="extensions" value="php"/>
|
||||||
|
<rule ref="PSR12"/>
|
||||||
|
|
||||||
|
<file>.</file>
|
||||||
|
</ruleset>
|
Reference in New Issue
Block a user