Skip to content

Commit

Permalink
[ci] switch travis dummy cs check, to Github Actions and ECS with mar…
Browse files Browse the repository at this point in the history
…kdown check
  • Loading branch information
TomasVotruba committed Oct 28, 2020
1 parent b215860 commit 2c94c03
Show file tree
Hide file tree
Showing 7 changed files with 56 additions and 89 deletions.
20 changes: 20 additions & 0 deletions .github/workflows/coding_standard.yaml
@@ -0,0 +1,20 @@
name: Coding Standard

on:
pull_request: null

jobs:
coding_standard:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2
# see https://github.com/shivammathur/setup-php
- uses: shivammathur/setup-php@v1
with:
php-version: 7.4
coverage: none

- run: composer install --no-progress

- run: vendor/bin/ecs check README.md --ansi
2 changes: 2 additions & 0 deletions .gitignore
@@ -0,0 +1,2 @@
composer.lock
/vendor
77 changes: 0 additions & 77 deletions .travis-build.php

This file was deleted.

11 changes: 0 additions & 11 deletions .travis.yml

This file was deleted.

2 changes: 1 addition & 1 deletion README.md
@@ -1,4 +1,4 @@
# Clean Code PHP
# Clean Code PHP

## Table of Contents

Expand Down
10 changes: 10 additions & 0 deletions composer.json
@@ -0,0 +1,10 @@
{
"require": {
"php": "^7.2",
"symplify/easy-coding-standard": "^8.3"
},
"scripts": {
"check-cs": "vendor/bin/ecs check README.md",
"fix-cs": "vendor/bin/ecs check README.md --fix"
}
}
23 changes: 23 additions & 0 deletions ecs.php
@@ -0,0 +1,23 @@
<?php

declare(strict_types=1);

use Symfony\Component\DependencyInjection\Loader\Configurator\ContainerConfigurator;
use Symplify\EasyCodingStandard\Configuration\Option;
use Symplify\EasyCodingStandard\ValueObject\Set\SetList;

return static function (ContainerConfigurator $containerConfigurator): void
{
$parameters = $containerConfigurator->parameters();
$parameters->set(Option::PATHS, [__DIR__ . '/src', __DIR__ . '/config', __DIR__ . '/ecs.php']);

$parameters->set(Option::SETS, [
SetList::COMMON,
SetList::CLEAN_CODE,
SetList::DEAD_CODE,
SetList::PSR_12,
SetList::PHP_70,
SetList::PHP_71,
SetList::SYMPLIFY,
]);
};

0 comments on commit 2c94c03

Please sign in to comment.