Skip to content

Commit

Permalink
Merge pull request #16 from ericsizemore/6.x-dev
Browse files Browse the repository at this point in the history
Bring 6.x dev to master, as we are close to 6.0.0 release
  • Loading branch information
ericsizemore authored May 6, 2024
2 parents 3f2785c + 35e549b commit 2803b79
Show file tree
Hide file tree
Showing 104 changed files with 4,912 additions and 2,138 deletions.
31 changes: 19 additions & 12 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -1,17 +1,24 @@
# Set the default behavior, in case people don't have core.autocrlf set.
* text eol=lf

*.gif binary
*.png binary

# Ignore all test and documentation with "export-ignore".
/.github export-ignore
/.gitattributes export-ignore
/.gitignore export-ignore
/.scrutinizer.yml export-ignore
/tests export-ignore
/composer.lock export-ignore
/mkdocs.yml export-ignore
/phpstan.neon export-ignore
/phpunit.xml export-ignore
/rector.php export-ignore
/.php-cs-fixer.dist.php export-ignore
/.github export-ignore
/docs export-ignore
/tests export-ignore
/.gitattributes export-ignore
/.gitignore export-ignore
/.php-cs-fixer.dist.php export-ignore
/.scrutinizer.yml export-ignore
/backward-compatibility.md export-ignore
/CHANGELOG.md export-ignore
/CODE_OF_CONDUCT.md export-ignore
/composer.lock export-ignore
/CONTRIBUTING.md export-ignore
/mkdocs.yml export-ignore
/phpstan.neon export-ignore
/phpstan-baseline.neon export-ignore
/phpunit.xml export-ignore
/renovate.json export-ignore
/UPGRADING.md export-ignore
58 changes: 58 additions & 0 deletions .github/ISSUE_TEMPLATE/1-bug_report.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
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 Simple Counter 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: minimal-reproducer
attributes:
label: Minimal Reproducer
description: |
Please provide a minimal code snippet 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 each code snippet.
validations:
required: true
- type: input
id: version
attributes:
label: Library Version
description: Which version of Simple Counter 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 Simple Counter being run on?
validations:
required: true
- type: dropdown
id: run-method
attributes:
label: How do you run Simple Counter?
multiple: false
options:
- Composer package
- Manual installation
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
23 changes: 23 additions & 0 deletions .github/ISSUE_TEMPLATE/2-feature_request.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
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: |
> [!IMPORTANT]
> Before requesting a new feature, make sure your version of Simple Counter is up-to-date.
- type: textarea
id: feature-request
attributes:
label: Feature Request
description: Please describe the feature you would like to see implemented.
validations:
required: true
- type: checkboxes
id: terms
attributes:
label: Contribution Checks
options:
- label: I have verified whether this feature request was already discussed.
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/simple_counter/discussions/categories/q-a
about: If you have any questions about configuring or using Simple Counter, please open a new Q&A discussion.
28 changes: 28 additions & 0 deletions .github/pull_request_template.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
# 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 implementation" 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/simple_counter/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 psalm` 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`
4 changes: 4 additions & 0 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,10 @@ on:
pull_request:
branches: [ master ]

env:
# see https://github.com/composer/composer/issues/9368#issuecomment-718112361
COMPOSER_ROOT_VERSION: "dev-master"

# Is it overkill to run PHPStan using different PHP versions? Probably :)
jobs:
phpstan:
Expand Down
22 changes: 22 additions & 0 deletions .github/workflows/psalm.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
name: Psalm Static analysis

on: [push, pull_request]

jobs:
psalm:
name: Psalm
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Psalm
uses: docker://vimeo/psalm-github-actions:latest
with:
args: --shepherd
composer_require_dev: true
security_analysis: true
report_file: results.sarif

- name: Upload Security Analysis results to GitHub
uses: github/codeql-action/upload-sarif@v3
with:
sarif_file: results.sarif
9 changes: 8 additions & 1 deletion .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,17 @@ on:
pull_request:
branches: [ master ]

env:
# see https://github.com/composer/composer/issues/9368#issuecomment-718112361
COMPOSER_ROOT_VERSION: "dev-master"

jobs:
test:
name: Run Unit Tests ${{ matrix.php }}
runs-on: ubuntu-latest
strategy:
matrix:
php: [ '8.2', '8.3', '8.4' ]
php: [ '8.2', '8.3' ]
steps:
- uses: actions/checkout@v4
with:
Expand Down Expand Up @@ -47,6 +51,9 @@ jobs:
- name: Run test suite
run: composer run-script test

- name: Coverage check
run: composer run-script coverage

- uses: sudo-bot/action-scrutinizer@latest
with:
cli-args: "--format=php-clover build/logs/clover.xml"
14 changes: 2 additions & 12 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,14 +1,4 @@
.idea/
vendor/
build/
site/
composer.phar
.phpunit.result.cache
dochtml/
vendor/
.php-cs-fixer.cache
*.iws
out/
.idea_modules/
atlassian-ide-plugin.xml
.idea/php.xml
.idea/simple_counter.iml
clover.xml
111 changes: 105 additions & 6 deletions .php-cs-fixer.dist.php
Original file line number Diff line number Diff line change
@@ -1,17 +1,116 @@
<?php

$config = new PhpCsFixer\Config();
declare(strict_types=1);

$header = <<<'EOF'
This file is part of Esi\SimpleCounter.
(c) Eric Sizemore <https://github.com/ericsizemore>
This source file is subject to the MIT license. For the full copyright and
license information, please view the LICENSE file that was distributed with
this source code.
EOF;

$config = new PhpCsFixer\Config();
$config
->setRiskyAllowed(true)
->setRules([
'@PER-CS' => true,
'@PSR2' => true,
'@PSR12' => true,
'@PHP83Migration' => true,
'array_syntax' => ['syntax' => 'short'],
'@PER-CS' => true,
'@PSR12' => true,
'@PHP82Migration' => true,
'align_multiline_comment' => true,
'array_syntax' => ['syntax' => 'short'],
'binary_operator_spaces' => [
'operators' => [
'*=' => 'align_single_space_minimal',
'+=' => 'align_single_space_minimal',
'-=' => 'align_single_space_minimal',
'/=' => 'align_single_space_minimal',
'=' => 'align_single_space_minimal',
'=>' => 'align_single_space_minimal',
],
],
'declare_equal_normalize' => ['space' => 'none'],
'declare_parentheses' => true,
'declare_strict_types' => true,
'fully_qualified_strict_types' => true,
'header_comment' => ['comment_type' => 'PHPDoc', 'header' => $header, 'separate' => 'top'],
'heredoc_to_nowdoc' => true,
//'global_namespace_import' => ['import_classes' => true, 'import_constants' => true, 'import_functions' => 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],
'no_leading_import_slash' => true,
'no_unneeded_import_alias' => true,
'no_unused_imports' => true,
'ordered_class_elements' => [
'order' => [
'use_trait',
'case',
'constant_public',
'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',
],
'ordered_imports' => ['imports_order' => ['class', 'function', 'const', ]],
'ordered_interfaces' => [
'direction' => 'ascend',
'order' => 'alpha',
],
'ordered_traits' => true,
'ordered_types' => true,
'phpdoc_align' => true,
'phpdoc_indent' => true,
'phpdoc_inline_tag_normalizer' => true,
'phpdoc_no_access' => true,
'phpdoc_no_alias_tag' => true,
'phpdoc_no_empty_return' => true,
'phpdoc_no_package' => true,
'phpdoc_no_useless_inheritdoc' => true,
'phpdoc_order' => true,
'phpdoc_param_order' => true,
'phpdoc_return_self_reference' => true,
'phpdoc_scalar' => true,
'phpdoc_separation' => true,
'phpdoc_single_line_var_spacing' => true,
'phpdoc_summary' => true,
'phpdoc_tag_casing' => true,
'phpdoc_tag_type' => true,
'phpdoc_to_comment' => false,
'phpdoc_trim' => true,
'phpdoc_trim_consecutive_blank_line_separation' => true,
'phpdoc_types_order' => true,
'phpdoc_var_annotation_correct_order' => true,
'phpdoc_var_without_name' => true,
'php_unit_internal_class' => ['types' => ['normal', 'final']],
'php_unit_expectation' => true,
'single_import_per_statement' => true,
'static_lambda' => true,
'strict_param' => true,
'use_arrow_functions' => true,
'whitespace_after_comma_in_array' => true,
])
->setLineEnding("\n")
->setFinder(
PhpCsFixer\Finder::create()
->in(__DIR__ . '/scripts')
->in(__DIR__ . '/src')
->in(__DIR__ . '/tests')
)
Expand Down
2 changes: 1 addition & 1 deletion .scrutinizer.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
build:
image: default-bionic
environment:
php: 8.2.13
php: 8.2.15
nodes:
analysis:
dependencies:
Expand Down
Loading

0 comments on commit 2803b79

Please sign in to comment.