Skip to content

Commit

Permalink
Merge pull request #49 from ergebnis/feature/synchronize
Browse files Browse the repository at this point in the history
Enhancement: Synchronize with ergebnis/php-library-template
  • Loading branch information
localheinz authored Jan 19, 2020
2 parents 9d25bba + f2e6ca0 commit f4fdf7a
Show file tree
Hide file tree
Showing 37 changed files with 139 additions and 103 deletions.
6 changes: 0 additions & 6 deletions .dependabot/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,14 +9,8 @@ update_configs:
commit_message:
include_scope: true
prefix: "Build"
default_assignees:
- "ergebnis-bot"
- "localheinz"
default_labels:
- "dependency"
default_reviewers:
- "ergebnis-bot"
- "localheinz"
directory: "/"
package_manager: "php:composer"
update_schedule: "live"
Expand Down
2 changes: 2 additions & 0 deletions .github/settings.yml
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,9 @@ repository:
allow_merge_commit: true
allow_rebase_merge: false
allow_squash_merge: false
archived: false
default_branch: "master"
delete_branch_on_merge: true
description: ":notebook: Provides a configuration factory and multiple rule sets for friendsofphp/php-cs-fixer."
has_downloads: true
has_issues: true
Expand Down
24 changes: 15 additions & 9 deletions .github/workflows/continuous-integration.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ on:
env:
MIN_COVERED_MSI: 100
MIN_MSI: 100
REQUIRED_PHP_EXTENSIONS: "filter, mbstring"
REQUIRED_PHP_EXTENSIONS: "mbstring"

jobs:
coding-standards:
Expand All @@ -32,7 +32,7 @@ jobs:
uses: "actions/[email protected]"

- name: "Install PHP with extensions"
uses: "shivammathur/[email protected].0"
uses: "shivammathur/[email protected].3"
with:
coverage: "none"
extensions: "${{ env.REQUIRED_PHP_EXTENSIONS }}"
Expand Down Expand Up @@ -94,7 +94,7 @@ jobs:
uses: "actions/[email protected]"

- name: "Install PHP with extensions"
uses: "shivammathur/[email protected].0"
uses: "shivammathur/[email protected].3"
with:
coverage: "none"
extensions: "${{ env.REQUIRED_PHP_EXTENSIONS }}"
Expand Down Expand Up @@ -140,7 +140,7 @@ jobs:
uses: "actions/[email protected]"

- name: "Install PHP with extensions"
uses: "shivammathur/[email protected].0"
uses: "shivammathur/[email protected].3"
with:
coverage: "none"
extensions: "${{ env.REQUIRED_PHP_EXTENSIONS }}"
Expand Down Expand Up @@ -200,7 +200,7 @@ jobs:
uses: "actions/[email protected]"

- name: "Install PHP with extensions"
uses: "shivammathur/[email protected].0"
uses: "shivammathur/[email protected].3"
with:
coverage: "none"
extensions: "${{ env.REQUIRED_PHP_EXTENSIONS }}"
Expand Down Expand Up @@ -252,7 +252,7 @@ jobs:
uses: "actions/[email protected]"

- name: "Install PHP with extensions"
uses: "shivammathur/[email protected].0"
uses: "shivammathur/[email protected].3"
with:
coverage: "xdebug"
extensions: "${{ env.REQUIRED_PHP_EXTENSIONS }}"
Expand Down Expand Up @@ -306,7 +306,7 @@ jobs:
uses: "actions/[email protected]"

- name: "Install PHP with extensions"
uses: "shivammathur/[email protected].0"
uses: "shivammathur/[email protected].3"
with:
coverage: "xdebug"
extensions: "${{ env.REQUIRED_PHP_EXTENSIONS }}"
Expand Down Expand Up @@ -334,8 +334,8 @@ jobs:
- name: "Run mutation tests with Xdebug and infection/infection"
run: "vendor/bin/infection --ignore-msi-with-no-mutations --min-covered-msi=${{ env.MIN_COVERED_MSI }} --min-msi=${{ env.MIN_MSI }}"

approve:
name: "Approve"
review:
name: "Review"

runs-on: "ubuntu-latest"

Expand All @@ -353,3 +353,9 @@ jobs:
if: "(github.actor == 'dependabot[bot]' || github.actor == 'dependabot-preview[bot]') && github.event_name == 'pull_request' && startsWith(github.event.pull_request.title, 'Build(deps-dev)')"
with:
github-token: "${{ secrets.ERGEBNIS_BOT_TOKEN }}"

- name: "Approve pull requests created by @ergebnis-bot that update the license year"
uses: "hmarr/[email protected]"
if: "github.actor == 'ergebnis-bot' && github.event_name == 'pull_request' && github.event.pull_request.title == 'Enhancement: Update license year'"
with:
github-token: "${{ secrets.ERGEBNIS_BOT_TOKEN }}"
25 changes: 16 additions & 9 deletions .github/workflows/license.yml
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
# https://help.github.com/en/categories/automating-your-workflow-with-github-actions

name: "Approve"
name: "License"

on:
schedule:
- cron: "1 0 1 1 *"

env:
REQUIRED_PHP_EXTENSIONS: "filter, mbstring"
REQUIRED_PHP_EXTENSIONS: "mbstring"

jobs:
approve:
license:
name: "License"

runs-on: "ubuntu-latest"
Expand All @@ -28,7 +28,7 @@ jobs:
uses: "actions/[email protected]"

- name: "Install PHP with extensions"
uses: "shivammathur/[email protected].0"
uses: "shivammathur/[email protected].3"
with:
coverage: "none"
extensions: "${{ env.REQUIRED_PHP_EXTENSIONS }}"
Expand Down Expand Up @@ -69,10 +69,17 @@ jobs:
- name: "Run friendsofphp/php-cs-fixer"
run: "vendor/bin/php-cs-fixer fix --config=.php_cs --diff --diff-format=udiff --dry-run --verbose"

- name: "Commit files with updated license year"
uses: "stefanzweifel/git-auto-commit-action@v2.5.0"
- name: "Open pull request updating license year"
uses: "gr2m/create-or-update-pull-request-action@v1.2.9"
with:
branch: "master"
commit_message: "Enhancement: Update license year"
author: "ergebnis-bot <[email protected]>"
branch: "feature/license-year"
body: |
This PR
* [x] updates the license year
commit-message: "Enhancement: Update license year"
path: "."
title: "Enhancement: Update license year"
env:
GITHUB_TOKEN: "${{ secrets.ERGEBNIS_GITHUB_TOKEN }}"
GITHUB_TOKEN: "${{ secrets.ERGEBNIS_BOT_TOKEN }}"
58 changes: 12 additions & 46 deletions .php_cs
Original file line number Diff line number Diff line change
Expand Up @@ -6,61 +6,27 @@ declare(strict_types=1);
* Copyright (c) 2019-2020 Andreas Möller
*
* For the full copyright and license information, please view
* the LICENSE file that was distributed with this source code.
* the LICENSE.md file that was distributed with this source code.
*
* @see https://github.com/ergebnis/php-cs-fixer-config
*/

use Ergebnis\License;
use Ergebnis\PhpCsFixer\Config;

$years = Config\License\Copyright\Years::fromRange(
Config\License\Copyright\Year::fromString('2019'),
Config\License\Copyright\Year::current()
);

$holder = Config\License\Copyright\Holder::fromString('Andreas Möller');

$file = Config\License\File::create(
$years,
$holder,
Config\License\Template::fromString(
<<<'EOF'
The MIT License (MIT)
Copyright (c) <copyright-years> <copyright-holder>
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated
documentation files (the "Software"), to deal in the Software without restriction, including without limitation the
rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit
persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the
Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

EOF
)
);

$file->saveAs(__DIR__ . '/LICENSE');

$header = Config\License\Header::create(
$years,
$holder,
Config\License\Notice::fromString(
<<<'EOF'
For the full copyright and license information, please view
the LICENSE file that was distributed with this source code.
EOF
$license = License\Type\MIT::markdown(
__DIR__ . '/LICENSE.md',
License\Range::since(
License\Year::fromString('2019'),
new \DateTimeZone('UTC')
),
Config\License\Url::fromString('https://github.com/ergebnis/php-cs-fixer-config')
License\Holder::fromString('Andreas Möller'),
License\Url::fromString('https://github.com/ergebnis/php-cs-fixer-config')
);

$config = Config\Factory::fromRuleSet(new Config\RuleSet\Php71($header->toString()));
$license->save();

$config = Config\Factory::fromRuleSet(new Config\RuleSet\Php71($license->header()));

$config->getFinder()
->ignoreDotFiles(false)
Expand Down
6 changes: 3 additions & 3 deletions LICENSE → LICENSE.md
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
The MIT License (MIT)
# The MIT License (MIT)

Copyright (c) 2019-2020 Andreas Möller

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated
documentation files (the "Software"), to deal in the Software without restriction, including without limitation the
documentation files (the _Software_), to deal in the Software without restriction, including without limitation the
rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit
persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the
Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
THE SOFTWARE IS PROVIDED **AS IS**, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
4 changes: 3 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,10 @@

[![Continuous Deployment](https://github.com/ergebnis/php-cs-fixer-config/workflows/Continuous%20Deployment/badge.svg)](https://github.com/ergebnis/php-cs-fixer-config/actions)
[![Continuous Integration](https://github.com/ergebnis/php-cs-fixer-config/workflows/Continuous%20Integration/badge.svg)](https://github.com/ergebnis/php-cs-fixer-config/actions)

[![Code Coverage](https://codecov.io/gh/ergebnis/php-cs-fixer-config/branch/master/graph/badge.svg)](https://codecov.io/gh/ergebnis/php-cs-fixer-config)
[![Type Coverage](https://shepherd.dev/github/ergebnis/php-cs-fixer-config/coverage.svg)](https://shepherd.dev/github/ergebnis/php-cs-fixer-config)

[![Latest Stable Version](https://poser.pugx.org/ergebnis/php-cs-fixer-config/v/stable)](https://packagist.org/packages/ergebnis/php-cs-fixer-config)
[![Total Downloads](https://poser.pugx.org/ergebnis/php-cs-fixer-config/downloads)](https://packagist.org/packages/ergebnis/php-cs-fixer-config)

Expand Down Expand Up @@ -268,7 +270,7 @@ Please have a look at [`CODE_OF_CONDUCT.md`](https://github.com/ergebnis/.github

## License

This package is licensed using the MIT License.
This package is licensed using the [MIT License](LICENSE.md).

## Credits

Expand Down
1 change: 1 addition & 0 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
},
"require-dev": {
"ergebnis/composer-normalize": "^2.2.2",
"ergebnis/license": "~0.1.0",
"ergebnis/phpstan-rules": "~0.14.2",
"ergebnis/test-util": "~0.9.1",
"infection/infection": "~0.13.6",
Expand Down
60 changes: 59 additions & 1 deletion composer.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion src/Factory.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
* Copyright (c) 2019-2020 Andreas Möller
*
* For the full copyright and license information, please view
* the LICENSE file that was distributed with this source code.
* the LICENSE.md file that was distributed with this source code.
*
* @see https://github.com/ergebnis/php-cs-fixer-config
*/
Expand Down
2 changes: 1 addition & 1 deletion src/License/Copyright/Holder.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
* Copyright (c) 2019-2020 Andreas Möller
*
* For the full copyright and license information, please view
* the LICENSE file that was distributed with this source code.
* the LICENSE.md file that was distributed with this source code.
*
* @see https://github.com/ergebnis/php-cs-fixer-config
*/
Expand Down
2 changes: 1 addition & 1 deletion src/License/Copyright/Year.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
* Copyright (c) 2019-2020 Andreas Möller
*
* For the full copyright and license information, please view
* the LICENSE file that was distributed with this source code.
* the LICENSE.md file that was distributed with this source code.
*
* @see https://github.com/ergebnis/php-cs-fixer-config
*/
Expand Down
2 changes: 1 addition & 1 deletion src/License/Copyright/Years.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
* Copyright (c) 2019-2020 Andreas Möller
*
* For the full copyright and license information, please view
* the LICENSE file that was distributed with this source code.
* the LICENSE.md file that was distributed with this source code.
*
* @see https://github.com/ergebnis/php-cs-fixer-config
*/
Expand Down
Loading

0 comments on commit f4fdf7a

Please sign in to comment.