Skip to content

Commit ffee71f

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

File tree

6 files changed

+62
-0
lines changed

6 files changed

+62
-0
lines changed

.editorconfig

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,3 +2,9 @@ root = true
22

33
[*]
44
insert_final_newline = true
5+
6+
[*.yaml]
7+
charset = utf-8
8+
indent_size = 2
9+
indent_style = space
10+
trim_trailing_whitespace = true

.github/workflows/integrate.yaml

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
# https://docs.github.com/en/actions
2+
3+
name: "Integrate"
4+
5+
on:
6+
pull_request: null
7+
push:
8+
branches:
9+
- "master"
10+
11+
jobs:
12+
coding-standards:
13+
name: "Coding Standards"
14+
15+
runs-on: "ubuntu-latest"
16+
17+
strategy:
18+
matrix:
19+
php-version:
20+
- "7.4"
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"

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,3 +6,4 @@ backend/GeoIP.dat
66
.idea
77
.DS_Store
88
.DS_Store?
9+
.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.8.0" installed="3.8.0" location="./.phive/php-cs-fixer" copy="true"/>
4+
</phive>

.phive/php-cs-fixer

2.48 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)