Skip to content

Commit

Permalink
Merge pull request #166 from matteosister/develop
Browse files Browse the repository at this point in the history
Merging ongoing develop to master
  • Loading branch information
GenieTim committed Mar 23, 2020
2 parents 48965bb + 9809e73 commit c1a738d
Show file tree
Hide file tree
Showing 98 changed files with 1,575 additions and 1,344 deletions.
46 changes: 46 additions & 0 deletions .github/workflows/code_checks.yaml
@@ -0,0 +1,46 @@
name: Code_Checks

on:
pull_request: null
push:
branches:
- master

jobs:
tests:
runs-on: ubuntu-latest
strategy:
matrix:
php: ['7.2', '7.3', '7.4']

name: PHP ${{ matrix.php }} tests
steps:
# basically git clone
- uses: actions/checkout@v2

# use PHP of specific version
- uses: shivammathur/setup-php@v1
with:
php-version: ${{ matrix.php }}
coverage: none # disable xdebug, pcov

- run: git --version
- run: git config --global user.email "test@github.com"
- run: git config --global user.name "GitHub Action"
- run: git --version

# if we 2 steps like this, we can better see if composer failed or tests
- run: composer install --no-progress

- run: composer tests

code_style:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: shivammathur/setup-php@v1
with:
php-version: 7.3
coverage: none # disable xdebug, pcov
- run: composer install --no-progress
- run: composer check-cs
24 changes: 18 additions & 6 deletions composer.json
@@ -1,6 +1,11 @@
{
"name": "cypresslab/gitelephant",
"description": "An abstraction layer for git written in PHP",
"scripts": {
"tests": "./vendor/bin/phpunit",
"check-cs": "./vendor/bin/ecs check",
"fix-cs": "./vendor/bin/ecs check --fix"
},
"keywords": [
"git"
],
Expand All @@ -14,21 +19,28 @@
],
"require": {
"php": ">=7.2.0",
"symfony/process": "~2.8|~3.0|~4.0",
"symfony/filesystem": "~2.8|~3.0|~4.0",
"symfony/finder": "~2.8|~3.0|~4.0",
"phpcollection/phpcollection": "~0.4"
"symfony/process": "~2.8|~3.0|~4.0|~5.0",
"symfony/filesystem": "~2.8|~3.0|~4.0|~5.0",
"symfony/finder": "~2.8|~3.0|~4.0|~5.0",
"phpcollection/phpcollection": "~0.4|~5.0"
},
"require-dev": {
"php": ">=7.2.0",
"phpunit/phpunit": "~8.0",
"phpunit/phpunit": "~8.0|~9.0",
"mockery/mockery": "~1.1",
"symfony/var-dumper": "3.*|4.*"
"symfony/var-dumper": "~3.0|~4.0|~5.0",
"rector/rector": "^0.7.6",
"symplify/easy-coding-standard": "^v7.2.5"
},
"minimum-stability": "stable",
"autoload": {
"psr-0": {
"GitElephant": "src/"
}
},
"autoload-dev": {
"psr-0": {
"GitElephant": "tests/"
}
}
}
24 changes: 24 additions & 0 deletions ecs.yaml
@@ -0,0 +1,24 @@
# ecs.yml
parameters:
sets:
- 'clean-code'
- 'psr2'
- 'psr12'
paths:
- 'src'
- 'tests'

# Skip two possible bugs in SlevomatCodingStandard\Sniffs\Variables\UnusedVariableSniff.UnusedVariable
skip:
'Unused variable $deleted.':
- 'src/GitElephant/Objects/Diff/DiffChunk.php'
'Unused variable $new.':
- 'src/GitElephant/Objects/Diff/DiffChunk.php'

services:
PhpCsFixer\Fixer\ArrayNotation\ArraySyntaxFixer:
syntax: short
Symplify\CodingStandard\Fixer\LineLength\LineLengthFixer:
max_line_length: 100 # default: 120
break_long_lines: true # default: true
inline_short_lines: false # default: true
15 changes: 15 additions & 0 deletions rector.yaml
@@ -0,0 +1,15 @@
parameters:
# autoload_paths:
# - 'vendor/autoload.php'
paths:
- 'src'
- 'tests'
php_version_features: '7.2'
sets:
- 'code-quality'
- 'symfony-code-quality'
- 'php71'
- 'php72'
- 'php73'
- 'phpunit90'

0 comments on commit c1a738d

Please sign in to comment.