Skip to content

Commit

Permalink
Merge pull request #22 from ericsizemore/2.x-dev
Browse files Browse the repository at this point in the history
Prepare 2.0.0
  • Loading branch information
ericsizemore committed Apr 21, 2024
2 parents 43b8a7a + 538ee29 commit 9734e61
Show file tree
Hide file tree
Showing 32 changed files with 2,124 additions and 859 deletions.
61 changes: 61 additions & 0 deletions .github/ISSUE_TEMPLATE/1-bug_report.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
name: Bug Report
description: Existing feature does not behave as expected.
labels: [ "bug", "unverified" ]
body:
- type: markdown
attributes:
value: |
Before reporting a bug, make sure PHPUnit Coverage Check is up-to-date and the problem is/was not reported already.
- type: textarea
id: problem-description
attributes:
label: Problem description
description: Please describe the problem you have encountered
validations:
required: true
- type: textarea
id: reproducer
attributes:
label: Reproducer
description: |
Please provide the clover file and CLI command that should be run to reproduce the problem.
If relevant, provide the expected output, the actual output and/or the error that occurred, if any.
Please use markdown syntax for the clover file contents, or provide a link to a remote clover file.
validations:
required: true
- type: input
id: version
attributes:
label: Library Version
description: Which version of PHPUnit Coverage Check is being run? (in X.Y.Z format)
validations:
required: true
- type: input
id: php-version
attributes:
label: PHP version
description: Which PHP version is PHPUnit Coverage Check being run on?
validations:
required: true
- type: dropdown
id: run-method
attributes:
label: How do you run PHPUnit Coverage Check?
multiple: false
options:
- Composer package
- Manual installation
- Phar binary
validations:
required: true
- type: checkboxes
id: terms
attributes:
label: Contribution Checks
options:
- label: I have verified whether this problem has already been reported.
required: false
- label: I am familiar with ["Bug or Feature?"](https://github.com/ericsizemore/phpunit-coverage-check/discussions/21)
required: false
36 changes: 36 additions & 0 deletions .github/ISSUE_TEMPLATE/2-feature_request.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
name: Feature Request
description: I have a suggestion for a new feature (and possibly want to implement it).
labels: [ "enhancement", "unverified" ]
body:
- type: markdown
attributes:
value: |
Before requesting a new feature, make sure your version of PHPUnit Coverage Check is up-to-date.
> [!NOTE]
> While it is not required to first create a [discussion](https://github.com/ericsizemore/phpunit-coverage-check/discussions/categories/ideas) before creating a request, it is preferable.
By first using [discussions](https://github.com/ericsizemore/phpunit-coverage-check/discussions/categories/ideas) to discuss a feature request or idea, it allows the scope of the request to be fleshed out and established before the actual issue is created.
- type: textarea
id: feature-request
attributes:
label: Feature Request
description: Please describe the feature you would like to see implemented.
validations:
required: true
- type: input
id: discussion-reference
attributes:
label: Link to the discussion where the feature request was discussed, if any.
placeholder: "https://github.com/ericsizemore/phpunit-coverage-check/discussions/<ID>"
validations:
required: false
- type: checkboxes
id: terms
attributes:
label: Contribution Checks
options:
- label: I have verified whether this feature request was already discussed.
required: false
- label: I am familiar with ["Bug or Feature?"](https://github.com/ericsizemore/phpunit-coverage-check/discussions/21)
required: false
5 changes: 5 additions & 0 deletions .github/ISSUE_TEMPLATE/config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
blank_issues_enabled: false
contact_links:
- name: Support question?
url: https://github.com/ericsizemore/phpunit-coverage-check/discussions/categories/q-a
about: If you have any questions about configuring or using PHPUnit Coverage Check, please open a new Q&A discussion.
27 changes: 27 additions & 0 deletions .github/pull_request_template.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
# Pull Request
<!--
PR title needs to be prefixed with a conventional commit type
(chore,ci,deprecate,docs,feat,fix,refactor,revert)
It should also be brief and descriptive for a good changelog entry
examples: "feat: add new command" or "fix: remove unused imports"
-->

## Proposed Changes
<!-- Describe what the changes are and link to a Discussion or Issue if one exists -->

## Readiness Checklist

### Author/Contributor

- [ ] You have read [CONTRIBUTING](https://github.com/ericsizemore/phpunit-coverage-check/blob/master/CONTRIBUTING.md)
- [ ] If documentation is needed for this change, has that been included in this pull request
- [ ] run `composer run-script test` and ensure you have test coverage for the lines you are introducing
- [ ] run `composer run-script phpstan` and fix any issues that you have introduced
- [ ] run `composer run-script cs:check` and fix any issues that you have introduced

### Reviewer

- [ ] Label as either `fix`, `documentation`, or `enhancement`
- [ ] Additionally label as `verified` or `unverified`
30 changes: 19 additions & 11 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,33 +3,41 @@ name: PHPStan
on:
workflow_dispatch:
push:
branches: [ master ]
branches:
- "master"
pull_request:
branches: [ master ]
branches:
- "master"

# Is it overkill to run PHPStan using different PHP versions? Probably :)
jobs:
phpstan:
name: PHPStan Static Analysis ${{ matrix.php }}
runs-on: ubuntu-latest
name: "PHPStan Static Analysis ${{ matrix.php-version }}, ${{ matrix.operating-system }}"
runs-on: ${{ matrix.operating-system }}
strategy:
matrix:
php: [ '8.1', '8.2', '8.3' ]
php-version:
- "8.2"
- "8.3"
operating-system:
- "ubuntu-latest"
- "windows-latest"
steps:
- uses: actions/checkout@v4

- name: Install PHP ${{ matrix.php }}
- name: "Install PHP ${{ matrix.php-version }}"
uses: shivammathur/setup-php@master
with:
php-version: ${{ matrix.php }}
php-version: "${{ matrix.php-version }}"
extensions: mbstring
tools: composer:v2

- name: Validate composer.json and composer.lock
- name: "Validate composer.json and composer.lock"
run: composer validate --strict

- name: Cache Composer packages
- name: "Cache Composer packages"
id: composer-cache
shell: bash
run: |
echo "dir=$(composer config cache-files-dir)" >> $GITHUB_OUTPUT
Expand All @@ -40,8 +48,8 @@ jobs:
restore-keys: |
${{ runner.os }}-composer-
- name: Install dependencies
- name: "Install dependencies"
run: composer install --prefer-dist --no-progress

- name: Run PHPStan
- name: "Run PHPStan"
run: composer run-script phpstan
36 changes: 22 additions & 14 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,35 +2,44 @@ name: Tests

on:
push:
branches: [ master ]
branches:
- "master"
pull_request:
branches: [ master ]
branches:
- "master"

jobs:
test:
name: Run Unit Tests ${{ matrix.php }}
runs-on: ubuntu-latest
name: "Run Unit Tests ${{ matrix.php-version }}, ${{ matrix.operating-system }}"
runs-on: ${{ matrix.operating-system }}
strategy:
matrix:
php: [ '8.1', '8.2', '8.3', '8.4' ]
php-version:
- "8.2"
- "8.3"
- "8.4"
operating-system:
- "ubuntu-latest"
- "windows-latest"
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 10

- name: Install PHP ${{ matrix.php }}
- name: "Install PHP ${{ matrix.php-version }}"
uses: shivammathur/setup-php@master
with:
php-version: ${{ matrix.php }}
extensions: mbstring,
coverage: xdebug,
php-version: "${{ matrix.php-version }}"
extensions: mbstring
coverage: xdebug
tools: composer:v2

- name: Validate composer.json and composer.lock
- name: "Validate composer.json and composer.lock"
run: composer validate --strict

- name: Cache Composer packages
- name: "Cache Composer packages"
id: composer-cache
shell: bash
run: |
echo "dir=$(composer config cache-files-dir)" >> $GITHUB_OUTPUT
Expand All @@ -41,13 +50,12 @@ jobs:
restore-keys: |
${{ runner.os }}-composer-
- name: Install dependencies
- name: "Install dependencies"
run: composer install --prefer-dist --no-progress

- name: Run test suite
- name: "Run test suite"
run: composer run-script test

- uses: sudo-bot/action-scrutinizer@latest
with:
cli-args: "--format=php-clover build/logs/clover.xml"

36 changes: 21 additions & 15 deletions .php-cs-fixer.dist.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,7 @@

declare(strict_types=1);

$currentYear = \date('Y');

$header = <<<EOF
$header = <<<'EOF'
This file is part of PHPUnit Coverage Check.
(c) Eric Sizemore <admin@secondversion.com>
Expand All @@ -21,12 +19,10 @@
->setRules([
'@PER-CS' => true,
'@PSR12' => true,
'@PHP81Migration' => true,
'@PHP82Migration' => true,
'array_syntax' => ['syntax' => 'short'],
'php_unit_internal_class' => ['types' => ['normal', 'final']],
'php_unit_namespaced' => true,
'php_unit_expectation' => true,
'php_unit_set_up_tear_down_visibility' => true,
'phpdoc_align' => true,
'phpdoc_indent' => true,
'phpdoc_inline_tag_normalizer' => true,
Expand All @@ -48,7 +44,6 @@
'phpdoc_var_without_name' => true,
'phpdoc_no_useless_inheritdoc' => true,
'align_multiline_comment' => true,
'phpdoc_add_missing_param_annotation' => ['only_untyped' => true],
'binary_operator_spaces' => [
'operators' => [
'*=' => 'align_single_space_minimal',
Expand All @@ -59,14 +54,19 @@
'=>' => 'align_single_space_minimal',
],
],
'heredoc_to_nowdoc' => true,
'ordered_imports' => ['imports_order' => ['class', 'function', 'const',]],
'no_unused_imports' => true,
'single_import_per_statement' => true,
'declare_equal_normalize' => ['space' => 'none'],
'declare_parentheses' => true,
'declare_strict_types' => true,
'global_namespace_import' => ['import_classes' => true, 'import_constants' => true, 'import_functions' => true],
'heredoc_to_nowdoc' => true,
'fully_qualified_strict_types' => true,
'ordered_imports' => ['imports_order' => ['class', 'function', 'const',]],
'no_leading_import_slash' => true,
'no_unneeded_import_alias' => true,
'no_unused_imports' => true,
'single_import_per_statement' => true,
'native_function_invocation' => ['include' => ['@compiler_optimized'], 'scope' => 'namespaced', 'strict' => true],
'native_constant_invocation' => ['fix_built_in' => false, 'include' => ['DIRECTORY_SEPARATOR', 'PHP_INT_SIZE', 'PHP_SAPI', 'PHP_VERSION_ID'], 'scope' => 'namespaced', 'strict' => true],
'declare_equal_normalize' => ['space' => 'none'],
'declare_parentheses' => true,
'declare_strict_types' => true,
//'global_namespace_import' => ['import_classes' => true, 'import_constants' => true, 'import_functions' => true],
'header_comment' => ['comment_type' => 'PHPDoc', 'header' => $header, 'separate' => 'top'],
'ordered_class_elements' => [
'order' => [
Expand All @@ -76,15 +76,21 @@
'constant_protected',
'constant_private',
'property_public',
'property_public_static',
'property_protected',
'property_protected_static',
'property_private',
'property_private_static',
'construct',
'destruct',
'magic',
'phpunit',
'method_public',
'method_public_static',
'method_protected',
'method_protected_static',
'method_private',
'method_private_static',
],
'sort_algorithm' => 'alpha',
],
Expand Down
Loading

0 comments on commit 9734e61

Please sign in to comment.