Skip to content

Commit

Permalink
chore: Added changelog, github status badge
Browse files Browse the repository at this point in the history
  • Loading branch information
ambroisemaupate committed Dec 2, 2024
1 parent f843d0e commit c30f5a9
Show file tree
Hide file tree
Showing 3 changed files with 125 additions and 2 deletions.
11 changes: 11 additions & 0 deletions CHANGELOG.md
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 -->
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# canonical-email
Simple PHP library to canonize email addresses from gmail.com, outlook.com or other providers that allow several forms of email.

[![Build Status](https://travis-ci.org/rezozero/canonical-email.svg?branch=master)](https://travis-ci.org/rezozero/canonical-email)
[![Static analysis and code style](https://github.com/rezozero/canonical-email/actions/workflows/run-test.yml/badge.svg)](https://github.com/rezozero/canonical-email/actions/workflows/run-test.yml)

**Be careful: do not store canonical email as primary email for login or sending emails!**
Your users may not be able to login again to your site if they used a specific email syntax which differs from canonical. Only store canonical emails in order to test against duplicates and prevent new users from creating multiple accounts with same email using variants.
Expand All @@ -10,7 +10,7 @@ Always store `email` and `canonical_email` in your databases.

## Strategies

- `LowercaseDomainStrategy`: for every emails, domain is case insensitive, so it should be lowercased.
- `LowercaseDomainStrategy`: for every email, domain is case-insensitive, so it should be lowercased.
- `GmailStrategy`: for `@gmail.com` addresses or whatever domain which MX servers are from Google GSuite (if `$checkMxRecords` is `true`). This will remove any dots, and any character after `+` sign. Then all email parts will be lowercased. When MX are checked, your app will use PHP `getmxrr` function.
- `OutlookStrategy`: for `@outlook.com` addresses. This will remove any character after `+` sign.

Expand Down
112 changes: 112 additions & 0 deletions cliff.toml
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

0 comments on commit c30f5a9

Please sign in to comment.