diff --git a/.gitattributes b/.gitattributes index d9c29c46..99692297 100644 --- a/.gitattributes +++ b/.gitattributes @@ -1,11 +1,13 @@ /.github/ export-ignore /test/ export-ignore +/tools/ export-ignore /.editorconfig export-ignore /.gitattributes export-ignore /.gitignore export-ignore /.php_cs export-ignore /infection.json export-ignore /Makefile export-ignore +/phive.xml export-ignore /phpstan-baseline.neon export-ignore /phpstan.neon export-ignore /psalm-baseline.xml export-ignore diff --git a/.github/CONTRIBUTING.md b/.github/CONTRIBUTING.md index 4a07dd7e..d0d33d0b 100644 --- a/.github/CONTRIBUTING.md +++ b/.github/CONTRIBUTING.md @@ -18,7 +18,7 @@ We are using [`yamllint`](https://github.com/adrienverge/yamllint) to enforce co If you do not have `yamllint` installed yet, run -``` +```sh $ brew install yamllint ``` @@ -28,7 +28,7 @@ We are using [`friendsofphp/php-cs-fixer`](https://github.com/FriendsOfPHP/PHP-C Run -``` +```sh $ make coding-standards ``` @@ -40,7 +40,7 @@ We are using [`maglnet/composer-require-checker`](https://github.com/maglnet/Com Run -``` +```sh $ make dependency-analysis ``` @@ -52,7 +52,7 @@ We are using [`phpstan/phpstan`](https://github.com/phpstan/phpstan) and [`vimeo Run -``` +```sh $ make static-code-analysis ``` @@ -62,7 +62,7 @@ We are also using the baseline features of [`phpstan/phpstan`](https://medium.co Run -``` +```sh $ make static-code-analysis-baseline ``` @@ -76,7 +76,7 @@ We are using [`phpunit/phpunit`](https://github.com/sebastianbergmann/phpunit) t Run -``` +```sh $ make tests ``` @@ -88,7 +88,7 @@ We are using [`infection/infection`](https://github.com/infection/infection) to Enable `pcov` or `Xdebug` and run -``` +```sh $ make mutation-tests ``` @@ -98,7 +98,7 @@ to run mutation tests. Run -``` +```sh $ make ``` @@ -108,7 +108,7 @@ to enforce coding standards, run a static code analysis, and run tests! :bulb: Run -``` +```sh $ make help ``` diff --git a/.github/dependabot.yml b/.github/dependabot.yml index 455760a4..c6a7b337 100644 --- a/.github/dependabot.yml +++ b/.github/dependabot.yml @@ -1,11 +1,11 @@ -# https://help.github.com/en/github/administering-a-repository/configuration-options-for-dependency-updates#target-branch +# https://help.github.com/en/github/administering-a-repository/configuration-options-for-dependency-updates version: 2 updates: - commit-message: include: "scope" - prefix: "Build" + prefix: "composer" directory: "/" labels: - "dependency" @@ -13,10 +13,11 @@ updates: package-ecosystem: "composer" schedule: interval: "daily" + versioning-strategy: "increase" - commit-message: include: "scope" - prefix: "Build" + prefix: "github-actions" directory: "/" labels: - "dependency" diff --git a/.github/workflows/integrate.yaml b/.github/workflows/integrate.yaml index fea753e4..265c2e8c 100644 --- a/.github/workflows/integrate.yaml +++ b/.github/workflows/integrate.yaml @@ -11,7 +11,7 @@ on: # yamllint disable-line rule:truthy env: MIN_COVERED_MSI: 95 MIN_MSI: 91 - REQUIRED_PHP_EXTENSIONS: "filter, mbstring" + PHP_EXTENSIONS: "mbstring" jobs: coding-standards: @@ -29,7 +29,7 @@ jobs: steps: - name: "Checkout" - uses: "actions/checkout@v2.3.0" + uses: "actions/checkout@v2.3.1" - name: "Lint YAML files" uses: "ibiqlik/action-yamllint@v1" @@ -42,7 +42,7 @@ jobs: uses: "shivammathur/setup-php@v2" with: coverage: "none" - extensions: "${{ env.REQUIRED_PHP_EXTENSIONS }}" + extensions: "${{ env.PHP_EXTENSIONS }}" php-version: "${{ matrix.php-version }}" - name: "Validate composer.json and composer.lock" @@ -102,13 +102,13 @@ jobs: steps: - name: "Checkout" - uses: "actions/checkout@v2.3.0" + uses: "actions/checkout@v2.3.1" - name: "Install PHP with extensions" uses: "shivammathur/setup-php@v2" with: coverage: "none" - extensions: "${{ env.REQUIRED_PHP_EXTENSIONS }}" + extensions: "${{ env.PHP_EXTENSIONS }}" php-version: "${{ matrix.php-version }}" - name: "Determine composer cache directory" @@ -135,7 +135,7 @@ jobs: run: "composer update --no-interaction --no-progress --no-suggest" - name: "Run maglnet/composer-require-checker" - uses: "docker://webfactory/composer-require-checker:2.1.0" + run: "tools/composer-require-checker check" static-code-analysis: name: "Static Code Analysis" @@ -152,13 +152,13 @@ jobs: steps: - name: "Checkout" - uses: "actions/checkout@v2.3.0" + uses: "actions/checkout@v2.3.1" - name: "Install PHP with extensions" uses: "shivammathur/setup-php@v2" with: coverage: "none" - extensions: "${{ env.REQUIRED_PHP_EXTENSIONS }}" + extensions: "${{ env.PHP_EXTENSIONS }}" php-version: "${{ matrix.php-version }}" - name: "Determine composer cache directory" @@ -230,13 +230,13 @@ jobs: steps: - name: "Checkout" - uses: "actions/checkout@v2.3.0" + uses: "actions/checkout@v2.3.1" - name: "Install PHP with extensions" uses: "shivammathur/setup-php@v2" with: coverage: "none" - extensions: "${{ env.REQUIRED_PHP_EXTENSIONS }}" + extensions: "${{ env.PHP_EXTENSIONS }}" php-version: "${{ matrix.php-version }}" - name: "Determine composer cache directory" @@ -286,13 +286,13 @@ jobs: steps: - name: "Checkout" - uses: "actions/checkout@v2.3.0" + uses: "actions/checkout@v2.3.1" - name: "Install PHP with extensions" uses: "shivammathur/setup-php@v2" with: coverage: "xdebug" - extensions: "${{ env.REQUIRED_PHP_EXTENSIONS }}" + extensions: "${{ env.PHP_EXTENSIONS }}" php-version: "${{ matrix.php-version }}" - name: "Determine composer cache directory" @@ -344,13 +344,13 @@ jobs: steps: - name: "Checkout" - uses: "actions/checkout@v2.3.0" + uses: "actions/checkout@v2.3.1" - name: "Install PHP with extensions" uses: "shivammathur/setup-php@v2" with: coverage: "xdebug" - extensions: "${{ env.REQUIRED_PHP_EXTENSIONS }}" + extensions: "${{ env.PHP_EXTENSIONS }}" php-version: "${{ matrix.php-version }}" - name: "Determine composer cache directory" @@ -399,7 +399,8 @@ jobs: github.event.action == 'reopened' || github.event.action == 'synchronize' ) && ( - (github.actor == 'dependabot[bot]' && startsWith(github.event.pull_request.title, 'Build(deps-dev)')) || + (github.actor == 'dependabot[bot]' && startsWith(github.event.pull_request.title, 'composer(deps-dev)')) || + (github.actor == 'dependabot[bot]' && startsWith(github.event.pull_request.title, 'github-actions(deps)')) || (github.actor == 'ergebnis-bot' && github.event.pull_request.title == 'Enhancement: Update license year') || (github.actor == 'localheinz' && contains(github.event.pull_request.labels.*.name, 'merge')) ) diff --git a/.github/workflows/renew.yaml b/.github/workflows/renew.yaml index a3ab9812..0d478096 100644 --- a/.github/workflows/renew.yaml +++ b/.github/workflows/renew.yaml @@ -7,7 +7,7 @@ on: # yamllint disable-line rule:truthy - cron: "1 0 1 1 *" env: - REQUIRED_PHP_EXTENSIONS: "mbstring" + PHP_EXTENSIONS: "mbstring" jobs: license: @@ -25,13 +25,13 @@ jobs: steps: - name: "Checkout" - uses: "actions/checkout@v2.3.0" + uses: "actions/checkout@v2.3.1" - name: "Install PHP with extensions" uses: "shivammathur/setup-php@v2" with: coverage: "none" - extensions: "${{ env.REQUIRED_PHP_EXTENSIONS }}" + extensions: "${{ env.PHP_EXTENSIONS }}" php-version: "${{ matrix.php-version }}" - name: "Validate composer.json and composer.lock" diff --git a/Makefile b/Makefile index 369b248e..1d92fecb 100644 --- a/Makefile +++ b/Makefile @@ -19,7 +19,7 @@ coding-standards: vendor ## Normalizes composer.json with ergebnis/composer-norm .PHONY: dependency-analysis dependency-analysis: vendor ## Runs a dependency analysis with maglnet/composer-require-checker - docker run --interactive --rm --tty --volume ${PWD}:/app webfactory/composer-require-checker:2.0.0 + tools/composer-require-checker check .PHONY: help help: ## Displays this list of targets with descriptions @@ -40,7 +40,6 @@ static-code-analysis: vendor ## Runs a static code analysis with phpstan/phpstan .PHONY: static-code-analysis-baseline static-code-analysis-baseline: vendor ## Generates a baseline for static code analysis with phpstan/phpstan and vimeo/psalm mkdir -p .build/phpstan - echo '' > phpstan-baseline.neon vendor/bin/phpstan analyze --configuration=phpstan.neon --generate-baseline=phpstan-baseline.neon mkdir -p .build/psalm vendor/bin/psalm --config=psalm.xml --set-baseline=psalm-baseline.xml diff --git a/README.md b/README.md index 1d441414..4325cade 100644 --- a/README.md +++ b/README.md @@ -17,7 +17,7 @@ Provides an abstraction of an open-source license. Run -```shell +```sh $ composer require --dev ergebnis/license ``` diff --git a/phive.xml b/phive.xml new file mode 100644 index 00000000..a88a0a03 --- /dev/null +++ b/phive.xml @@ -0,0 +1,4 @@ + + + + diff --git a/tools/composer-require-checker b/tools/composer-require-checker new file mode 100755 index 00000000..5b513986 Binary files /dev/null and b/tools/composer-require-checker differ