Skip to content

Commit c83096a

Browse files
authored
Release/1.0.0 (#1)
* feat: Implement structured logging with redaction support and add redaction strategies for documents, emails, and phone numbers.
1 parent 5f77fc6 commit c83096a

26 files changed

+1919
-1
lines changed

.gitattributes

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
/tests export-ignore
2+
/vendor export-ignore
3+
4+
/README.md export-ignore
5+
/LICENSE export-ignore
6+
/Makefile export-ignore
7+
/phpunit.xml export-ignore
8+
/phpstan.neon.dist export-ignore
9+
/infection.json.dist export-ignore
10+
11+
/.github export-ignore
12+
/.gitignore export-ignore
13+
/.gitattributes export-ignore

.github/dependabot.yml

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
version: 2
2+
3+
updates:
4+
- package-ecosystem: "composer"
5+
directory: "/"
6+
schedule:
7+
interval: "weekly"
8+
open-pull-requests-limit: 0
9+
labels:
10+
- "php"
11+
- "security"
12+
- "dependencies"
13+
groups:
14+
php-security:
15+
applies-to: security-updates
16+
patterns:
17+
- "*"
18+
19+
- package-ecosystem: "github-actions"
20+
directory: "/"
21+
schedule:
22+
interval: "weekly"
23+
commit-message:
24+
prefix: "build"
25+
labels:
26+
- "dependencies"
27+
- "github-actions"
28+
groups:
29+
github-actions:
30+
patterns:
31+
- "*"

.github/workflows/auto-assign.yml

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
name: Auto assign issues and pull requests
2+
3+
on:
4+
issues:
5+
types:
6+
- opened
7+
pull_request:
8+
types:
9+
- opened
10+
11+
jobs:
12+
run:
13+
runs-on: ubuntu-latest
14+
permissions:
15+
issues: write
16+
pull-requests: write
17+
steps:
18+
- name: Assign issues and pull requests
19+
uses: gustavofreze/auto-assign@2.1.0
20+
with:
21+
assignees: '${{ vars.ASSIGNEES }}'
22+
github_token: '${{ secrets.GITHUB_TOKEN }}'
23+
allow_self_assign: 'true'
24+
allow_no_assignees: 'true'
25+
assignment_options: 'ISSUE,PULL_REQUEST'

.github/workflows/ci.yml

Lines changed: 87 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,87 @@
1+
name: CI
2+
3+
on:
4+
pull_request:
5+
6+
permissions:
7+
contents: read
8+
9+
env:
10+
PHP_VERSION: '8.5'
11+
12+
jobs:
13+
build:
14+
name: Build
15+
runs-on: ubuntu-latest
16+
17+
steps:
18+
- name: Checkout
19+
uses: actions/checkout@v6
20+
21+
- name: Configure PHP
22+
uses: shivammathur/setup-php@v2
23+
with:
24+
php-version: ${{ env.PHP_VERSION }}
25+
tools: composer:2
26+
27+
- name: Validate composer.json
28+
run: composer validate --no-interaction
29+
30+
- name: Install dependencies
31+
run: composer install --no-progress --optimize-autoloader --prefer-dist --no-interaction
32+
33+
- name: Upload vendor and composer.lock as artifact
34+
uses: actions/upload-artifact@v6
35+
with:
36+
name: vendor-artifact
37+
path: |
38+
vendor
39+
composer.lock
40+
41+
auto-review:
42+
name: Auto review
43+
runs-on: ubuntu-latest
44+
needs: build
45+
46+
steps:
47+
- name: Checkout
48+
uses: actions/checkout@v6
49+
50+
- name: Configure PHP
51+
uses: shivammathur/setup-php@v2
52+
with:
53+
php-version: ${{ env.PHP_VERSION }}
54+
tools: composer:2
55+
56+
- name: Download vendor artifact from build
57+
uses: actions/download-artifact@v7
58+
with:
59+
name: vendor-artifact
60+
path: .
61+
62+
- name: Run review
63+
run: composer review
64+
65+
tests:
66+
name: Tests
67+
runs-on: ubuntu-latest
68+
needs: auto-review
69+
70+
steps:
71+
- name: Checkout
72+
uses: actions/checkout@v6
73+
74+
- name: Configure PHP
75+
uses: shivammathur/setup-php@v2
76+
with:
77+
php-version: ${{ env.PHP_VERSION }}
78+
tools: composer:2
79+
80+
- name: Download vendor artifact from build
81+
uses: actions/download-artifact@v7
82+
with:
83+
name: vendor-artifact
84+
path: .
85+
86+
- name: Run tests
87+
run: composer tests

.github/workflows/codeql.yml

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
name: Security checks
2+
3+
on:
4+
push:
5+
branches: [ "main" ]
6+
pull_request:
7+
branches: [ "main" ]
8+
schedule:
9+
- cron: "0 0 * * *"
10+
11+
permissions:
12+
actions: read
13+
contents: read
14+
security-events: write
15+
16+
jobs:
17+
analyze:
18+
name: Analyze
19+
runs-on: ubuntu-latest
20+
strategy:
21+
fail-fast: false
22+
matrix:
23+
language: [ "actions" ]
24+
25+
steps:
26+
- name: Checkout repository
27+
uses: actions/checkout@v6
28+
29+
- name: Initialize CodeQL
30+
uses: github/codeql-action/init@v4
31+
with:
32+
languages: ${{ matrix.language }}
33+
34+
- name: Perform CodeQL analysis
35+
uses: github/codeql-action/analyze@v4

.gitignore

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
.idea
2+
3+
vendor
4+
report
5+
.phpunit.*
6+
7+
*.lock

Makefile

Lines changed: 68 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,68 @@
1+
PWD := $(CURDIR)
2+
ARCH := $(shell uname -m)
3+
PLATFORM :=
4+
5+
ifeq ($(ARCH),arm64)
6+
PLATFORM := --platform=linux/amd64
7+
endif
8+
9+
DOCKER_RUN = docker run ${PLATFORM} --rm -it --net=host -v ${PWD}:/app -w /app gustavofreze/php:8.5-alpine
10+
11+
RESET := \033[0m
12+
GREEN := \033[0;32m
13+
YELLOW := \033[0;33m
14+
15+
.DEFAULT_GOAL := help
16+
17+
.PHONY: configure
18+
configure: ## Configure development environment
19+
@${DOCKER_RUN} composer update --optimize-autoloader
20+
21+
.PHONY: test
22+
test: ## Run all tests with coverage
23+
@${DOCKER_RUN} composer tests
24+
25+
.PHONY: test-file
26+
test-file: ## Run tests for a specific file (usage: make test-file FILE=path/to/file)
27+
@${DOCKER_RUN} composer test-file ${FILE}
28+
29+
.PHONY: test-no-coverage
30+
test-no-coverage: ## Run all tests without coverage
31+
@${DOCKER_RUN} composer tests-no-coverage
32+
33+
.PHONY: review
34+
review: ## Run static code analysis
35+
@${DOCKER_RUN} composer review
36+
37+
.PHONY: show-reports
38+
show-reports: ## Open static analysis reports (e.g., coverage, lints) in the browser
39+
@sensible-browser report/coverage/coverage-html/index.html report/coverage/mutation-report.html
40+
41+
.PHONY: clean
42+
clean: ## Remove dependencies and generated artifacts
43+
@sudo chown -R ${USER}:${USER} ${PWD}
44+
@rm -rf report vendor .phpunit.cache *.lock
45+
46+
.PHONY: help
47+
help: ## Display this help message
48+
@echo "Usage: make [target]"
49+
@echo ""
50+
@echo "$$(printf '$(GREEN)')Setup$$(printf '$(RESET)')"
51+
@grep -E '^(configure):.*?## .*$$' $(MAKEFILE_LIST) \
52+
| awk 'BEGIN {FS = ":.*? ## "}; {printf "$(YELLOW)%-25s$(RESET) %s\n", $$1, $$2}'
53+
@echo ""
54+
@echo "$$(printf '$(GREEN)')Testing$$(printf '$(RESET)')"
55+
@grep -E '^(test|test-file|test-no-coverage):.*?## .*$$' $(MAKEFILE_LIST) \
56+
| awk 'BEGIN {FS = ":.*?## "}; {printf "$(YELLOW)%-25s$(RESET) %s\n", $$1, $$2}'
57+
@echo ""
58+
@echo "$$(printf '$(GREEN)')Quality$$(printf '$(RESET)')"
59+
@grep -E '^(review):.*?## .*$$' $(MAKEFILE_LIST) \
60+
| awk 'BEGIN {FS = ":.*?## "}; {printf "$(YELLOW)%-25s$(RESET) %s\n", $$1, $$2}'
61+
@echo ""
62+
@echo "$$(printf '$(GREEN)')Reports$$(printf '$(RESET)')"
63+
@grep -E '^(show-reports):.*?## .*$$' $(MAKEFILE_LIST) \
64+
| awk 'BEGIN {FS = ":.*?## "}; {printf "$(YELLOW)%-25s$(RESET) %s\n", $$1, $$2}'
65+
@echo ""
66+
@echo "$$(printf '$(GREEN)')Cleanup$$(printf '$(RESET)')"
67+
@grep -E '^(clean):.*?## .*$$' $(MAKEFILE_LIST) \
68+
| awk 'BEGIN {FS = ":.*?## "}; {printf "$(YELLOW)%-25s$(RESET) %s\n", $$1, $$2}'

0 commit comments

Comments
 (0)