-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #5 from rezozero/upgrade_deps
feat: Upgraded to PHP 7.4 min, use strict_types, upgraded dev dependencies, removed useless phpdocs
- Loading branch information
Showing
23 changed files
with
219 additions
and
67 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
name: Static analysis and code style | ||
|
||
on: | ||
push: | ||
branches: | ||
- master | ||
tags: ['**'] | ||
pull_request: | ||
types: | ||
- opened | ||
- reopened | ||
- synchronize | ||
- ready_for_review | ||
|
||
jobs: | ||
static-analysis-tests: | ||
runs-on: ubuntu-latest | ||
strategy: | ||
matrix: | ||
php-version: ['7.4', '8.0', '8.1', '8.2', '8.3', '8.4'] | ||
steps: | ||
- uses: shivammathur/setup-php@v2 | ||
with: | ||
php-version: ${{ matrix.php-version }} | ||
- uses: actions/checkout@v3 | ||
- name: Cache Composer packages | ||
id: composer-cache | ||
uses: actions/cache@v3 | ||
with: | ||
path: vendor | ||
key: ${{ runner.os }}-php-${{ matrix.php-version }}-${{ hashFiles('**/composer.lock') }} | ||
restore-keys: | | ||
${{ runner.os }}-php-${{ matrix.php-version }}- | ||
- name: Install Dependencies | ||
run: composer install --no-scripts --no-ansi --no-interaction --no-progress | ||
- name: Run PHP CS fixer | ||
env: | ||
PHP_CS_FIXER_IGNORE_ENV: 1 | ||
run: vendor/bin/php-cs-fixer check --ansi -vvv | ||
- name: Run PHP Unit tests | ||
run: vendor/bin/phpunit --bootstrap vendor/autoload.php tests/ | ||
- name: Run PHPStan | ||
run: vendor/bin/phpstan analyse --no-progress -c phpstan.neon |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
<?php | ||
|
||
$finder = (new PhpCsFixer\Finder()) | ||
->in(__DIR__) | ||
->exclude([ | ||
'vendor', | ||
]) | ||
; | ||
|
||
return (new PhpCsFixer\Config()) | ||
->setRules([ | ||
'blank_line_after_opening_tag' => true, | ||
'declare_strict_types' => true, | ||
]) | ||
->setParallelConfig(PhpCsFixer\Runner\Parallel\ParallelConfigFactory::detect()) | ||
->setRiskyAllowed(true) | ||
->setFinder($finder) | ||
; |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
# Changelog | ||
|
||
All notable changes to canonical-email will be documented in this file. | ||
|
||
## [1.1.0](https://github.com/rezozero/canonical-email/compare/1.0.2...1.1.0) - 2024-12-02 | ||
|
||
### Features | ||
|
||
- Upgraded to PHP 7.4 min, use strict_types, upgraded dev dependencies, removed useless phpdocs - ([f843d0e](https://github.com/rezozero/canonical-email/commit/f843d0e0099d9f171331ea05c8d38e416142ea3a)) | ||
|
||
<!-- generated by git-cliff --> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
test : | ||
./vendor/bin/phpunit --bootstrap vendor/autoload.php tests/ | ||
./vendor/bin/phpcbf -p | ||
./vendor/bin/phpstan analyse -c phpstan.neon | ||
vendor/bin/phpunit --bootstrap vendor/autoload.php tests/ | ||
PHP_CS_FIXER_IGNORE_ENV=1 vendor/bin/php-cs-fixer fix --ansi -vvv | ||
vendor/bin/phpstan analyse -c phpstan.neon |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,112 @@ | ||
# git-cliff ~ default configuration file | ||
# https://git-cliff.org/docs/configuration | ||
# | ||
# Lines starting with "#" are comments. | ||
# Configuration options are organized into tables and keys. | ||
# See documentation for more information on available options. | ||
|
||
[changelog] | ||
# changelog header | ||
header = """ | ||
# Changelog\n | ||
All notable changes to canonical-email will be documented in this file.\n | ||
""" | ||
# template for the changelog body | ||
# https://keats.github.io/tera/docs/#introduction | ||
body = """ | ||
{% if version %}\ | ||
{% if previous.version %}\ | ||
## [{{ version | trim_start_matches(pat="v") }}](<REPO>/compare/{{ previous.version }}...{{ version }}) - {{ timestamp | date(format="%Y-%m-%d") }} | ||
{% else %}\ | ||
## [{{ version | trim_start_matches(pat="v") }}] - {{ timestamp | date(format="%Y-%m-%d") }} | ||
{% endif %}\ | ||
{% else %}\ | ||
## [unreleased] | ||
{% endif %}\ | ||
{% set_global breaking_descriptions = [] %}\ | ||
{% for commit in commits | filter(attribute="breaking", value=true) | unique(attribute="message") %}\ | ||
{% if commit.breaking_description %}\ | ||
{% set_global breaking_descriptions = breaking_descriptions | concat(with=commit.breaking_description) %}\ | ||
{% else %}\ | ||
{% set_global breaking_descriptions = breaking_descriptions | concat(with=commit.message) %}\ | ||
{% endif %}\ | ||
{% endfor %}\ | ||
{% if breaking_descriptions | length > 0 %} | ||
### ⚠ Breaking changes | ||
{% for description in breaking_descriptions %} | ||
- {{ description | upper_first }}\ | ||
{% endfor %} | ||
{% endif %}\ | ||
{% for group, commits in commits | group_by(attribute="group") %} | ||
### {{ group | striptags | trim | upper_first }} | ||
{% for commit in commits | ||
| filter(attribute="scope") | ||
| unique(attribute="message") | ||
| sort(attribute="scope") %} | ||
- **({{commit.scope}})**{% if commit.breaking %} [**breaking**]{% endif %} \ | ||
{{ commit.message }} - ([{{ commit.id | truncate(length=7, end="") }}](<REPO>/commit/{{ commit.id }})) | ||
{%- endfor -%} | ||
{% raw %}\n{% endraw %}\ | ||
{%- for commit in commits | unique(attribute="message") %} | ||
{%- if commit.scope -%} | ||
{% else -%} | ||
- {% if commit.breaking %} [**breaking**]{% endif %}\ | ||
{{ commit.message }} - ([{{ commit.id | truncate(length=7, end="") }}](<REPO>/commit/{{ commit.id }})) | ||
{% endif -%} | ||
{% endfor -%} | ||
{% endfor %}\n | ||
""" | ||
# remove the leading and trailing whitespace from the template | ||
trim = true | ||
# changelog footer | ||
footer = """ | ||
<!-- generated by git-cliff --> | ||
""" | ||
# postprocessors | ||
postprocessors = [ | ||
{ pattern = '<REPO>', replace = "https://github.com/rezozero/canonical-email" }, | ||
] | ||
[git] | ||
# parse the commits based on https://www.conventionalcommits.org | ||
conventional_commits = true | ||
# filter out the commits that are not conventional | ||
filter_unconventional = true | ||
# process each line of a commit as an individual commit | ||
split_commits = false | ||
# regex for preprocessing the commit messages | ||
commit_preprocessors = [ | ||
{ pattern = '\((\w+\s)?#([0-9]+)\)', replace = "([#${2}](<REPO>/issues/${2}))"}, # replace issue numbers | ||
] | ||
# regex for parsing and grouping commits | ||
commit_parsers = [ | ||
{ message = "^feat(ure)?", group = "Features" }, | ||
{ message = "^fix(es)?", group = "Bug Fixes" }, | ||
{ message = "^docs?", group = "Documentation" }, | ||
{ message = "^perf", group = "Performance" }, | ||
{ message = "^refactor", group = "Refactor" }, | ||
{ message = "^style", group = "Styling" }, | ||
{ message = "^tests?", group = "Testing" }, | ||
{ message = "^chore", skip = true }, | ||
{ message = "^ci", group = "CI/CD" }, | ||
{ body = ".*security", group = "Security" }, | ||
{ message = "^revert", group = "Revert" }, | ||
] | ||
# protect breaking changes from being skipped due to matching a skipping commit_parser | ||
protect_breaking_commits = false | ||
# filter out the commits that are not matched by commit parsers | ||
filter_commits = true | ||
# regex for matching git tags | ||
tag_pattern = "v?[0-9].*" | ||
|
||
# regex for skipping tags | ||
skip_tags = "v0.1.0-beta.1" | ||
# regex for ignoring tags | ||
ignore_tags = "" | ||
# sort the tags topologically | ||
topo_order = true | ||
# sort the commits inside sections by oldest/newest order | ||
sort_commits = "newest" | ||
# limit the number of commits included in the changelog. | ||
# limit_commits = 42 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,5 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
namespace RZ\CanonicalEmail\Strategy; | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.