Skip to content

Commit d70019a

Browse files
committed
Enhancement: Run friendsofphp/php-cs-fixer on GitHub Actions
1 parent a83ae2f commit d70019a

File tree

5 files changed

+46
-0
lines changed

5 files changed

+46
-0
lines changed

.github/workflows/integrate.yaml

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,33 @@ on:
99
- "master"
1010

1111
jobs:
12+
coding-standards:
13+
name: "Coding Standards"
14+
15+
runs-on: "ubuntu-latest"
16+
17+
strategy:
18+
matrix:
19+
php-version:
20+
- "7.3"
21+
22+
steps:
23+
- name: "Checkout"
24+
uses: "actions/checkout@v3"
25+
26+
- name: "Set up PHP"
27+
uses: "shivammathur/setup-php@v2"
28+
with:
29+
coverage: "none"
30+
extensions: "none, json, tokenizer"
31+
php-version: "${{ matrix.php-version }}"
32+
33+
- name: "Set up problem matchers for PHP"
34+
run: "echo \"::add-matcher::${{ runner.tool_cache }}/php.json\""
35+
36+
- name: "Run friendsofphp/php-cs-fixer"
37+
run: ".phive/php-cs-fixer fix --ansi --config=.php-cs-fixer.php --diff --dry-run --verbose"
38+
1239
tests:
1340
name: "Tests"
1441

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,3 +5,4 @@ backend/GeoIP.dat
55
.idea
66
.DS_Store
77
.DS_Store?
8+
.php-cs-fixer.cache

.phive/phars.xml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<phive xmlns="https://phar.io/phive">
3+
<phar name="php-cs-fixer" version="3.5.0" installed="3.5.0" location="./.phive/php-cs-fixer" copy="true"/>
4+
</phive>

.phive/php-cs-fixer

2.46 MB
Binary file not shown.

.php-cs-fixer.php

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
<?php
2+
3+
$finder = PhpCsFixer\Finder::create()->in(__DIR__);
4+
5+
$config = new PhpCsFixer\Config();
6+
7+
$finder = $config->getFinder()
8+
->ignoreDotFiles(false)
9+
->in(__DIR__)
10+
->name('.php-cs-fixer.php');
11+
12+
$config->setRules([]);
13+
14+
return $config;

0 commit comments

Comments
 (0)