Skip to content

Commit d63750a

Browse files
committed
chore: update tooling configuration and documentation
Update makefile targets to use dot notation (lint.phpstan instead of lint-phpstan). Update deptrac layer dependencies to include Hyperf and Testing layers. Adjust CI workflow step ordering and improve documentation references.
1 parent e8a0e53 commit d63750a

6 files changed

Lines changed: 60 additions & 65 deletions

File tree

.ai/guidelines.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ The project uses PHP-CS-Fixer with a combination of PSR2, Symfony, DoctrineAnnot
1818

1919
```bash
2020
# Check code style
21-
make lint-phpcs
21+
make lint.phpcs
2222

2323
# Fix code style issues
2424
make fix
@@ -30,19 +30,19 @@ The project uses multiple static analysis tools to maintain code quality:
3030

3131
```bash
3232
# Run PHPStan
33-
make lint-phpstan
33+
make lint.phpstan
3434

3535
# Run Psalm
36-
make lint-psalm
36+
make lint.psalm
3737

3838
# Run Deptrac (dependency analysis)
39-
make lint-deptrac
39+
make lint.deptrac
4040

4141
# Run PHP Mess Detector
42-
make lint-phpmd
42+
make lint.phpmd
4343

4444
# Run Rector (with dry-run)
45-
make lint-rector
45+
make lint.rector
4646

4747
# Run all linting tools
4848
make lint

.ai/quickstart.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -156,9 +156,9 @@ docker-compose exec app composer test -- --filter=ExampleTest
156156
make lint
157157

158158
# Check specific tools
159-
make lint-phpstan # Static analysis
160-
make lint-phpcs # Code style
161-
make lint-psalm # Additional static analysis
159+
make lint.phpstan # Static analysis
160+
make lint.phpcs # Code style
161+
make lint.psalm # Additional static analysis
162162
```
163163

164164
## Development Environment

.github/workflows/test.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ jobs:
1515
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
1616

1717
steps:
18-
- name: Cache Docker images.
18+
- name: Cache Docker images
1919
uses: ScribeMD/docker-cache@0.5.0
2020
with:
2121
key: docker-${{ runner.os }}-${{ hashFiles('compose.yaml') }}
@@ -31,9 +31,6 @@ jobs:
3131
- name: Put everything up
3232
run: docker compose --profile postgres up -d
3333

34-
- name: Setup the application environment
35-
run: docker compose exec app composer install
36-
3734
- name: Wait until 1 minute for postgres be ready to GO
3835
uses: nick-fields/retry@v3
3936
with:
@@ -43,6 +40,9 @@ jobs:
4340
warning_on_retry: false
4441
command: docker compose exec postgres pg_isready
4542

43+
- name: Setup the application environment
44+
run: docker compose exec app composer install
45+
4646
- name: Configure database environment
4747
run: docker compose exec app php bin/hyperf.php migrate --database=postgres
4848

composer.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@
1212
"Serendipity\\": "src/"
1313
},
1414
"files": [
15-
"src/_/mirror.php",
1615
"src/_/runtime.php"
1716
]
1817
},

deptrac.yaml

Lines changed: 41 additions & 45 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,11 @@ deptrac:
2121
^Constructo\\Type\\.*|\
2222
^Constructo\\Factory\\.*
2323

24+
- name: Hyperf
25+
collectors:
26+
- type: classLike
27+
value: ^Serendipity\\Hyperf\\.*
28+
2429
- name: Infrastructure
2530
collectors:
2631
- type: classLike
@@ -31,61 +36,42 @@ deptrac:
3136
- type: classLike
3237
value: ^Serendipity\\Presentation\\.*
3338

34-
# Define the supported global layers
39+
- name: Testing
40+
collectors:
41+
- type: classLike
42+
value: ^Serendipity\\Testing\\.*
43+
3544
- name: Contract
3645
collectors:
3746
- type: classLike
3847
value:
48+
^Psr\\.*|\
49+
^Constructo\\Contract\\.*|\
3950
^Hyperf\\Contract\\.*|\
40-
^Psr\\Container\\ContainerExceptionInterface$|\
41-
^Psr\\Container\\NotFoundExceptionInterface$|\
42-
^Psr\\EventDispatcher\\EventDispatcherInterface$|\
43-
^Constructo\\Contract\\.*
51+
^Hyperf\\HttpServer\\Contract\\.*|\
52+
^Hyperf\\Validation\\.*|\
53+
^Hyperf\\Context\\Context$
4454

4555
- name: Native
4656
collectors:
4757
- type: classLike
4858
value: ^\w+$|^(DS|Decimal)\\.*$
4959

5060
- name: Vendor
51-
collectors:
52-
- type: bool
53-
must:
54-
- type: classLike
55-
value:
56-
^Psr\\(Http|Log|Container)\\.*|\
57-
^Hyperf\\(Command|Context|Coordinator|DB|Event|ExceptionHandler|Guzzle|HttpMessage|HttpServer)\\.*|\
58-
^Google\\.*|\
59-
^GuzzleHttp\\.*|\
60-
^SleekDB\\.*|\
61-
^Visus\\Cuid2\\.*|\
62-
^Sentry\\.*|\
63-
^Swow\\.*|\
64-
^MongoDB\\.*|\
65-
^Symfony\\.*
66-
must_not:
67-
- type: classLike
68-
value:
69-
^Hyperf\\Contract\\.*|\
70-
^Psr\\Container\\ContainerInterface$|\
71-
^Psr\\Container\\ContainerExceptionInterface$|\
72-
^Psr\\Container\\NotFoundExceptionInterface$|\
73-
^Psr\\Http\\Message\\ServerRequestInterface$|\
74-
^Psr\\EventDispatcher\\EventDispatcherInterface$|\
75-
^Hyperf\\Context\\Context$|\
76-
^Hyperf\\Validation\\ValidationException$|\
77-
^Hyperf\\Validation\\Request\\FormRequest$
78-
79-
- name: Validation
8061
collectors:
8162
- type: classLike
8263
value:
83-
^Serendipity\\Hyperf\\Request\\HyperfFormRequest$|\
84-
^Psr\\Container\\ContainerInterface$|\
85-
^Psr\\Http\\Message\\ServerRequestInterface$|\
86-
^Hyperf\\Context\\Context$|\
87-
^Hyperf\\Validation\\ValidationException$|\
88-
^Hyperf\\Validation\\Request\\FormRequest$
64+
^Google\\.*|\
65+
^GuzzleHttp\\.*|\
66+
^SleekDB\\.*|\
67+
^Visus\\Cuid2\\.*|\
68+
^Sentry\\.*|\
69+
^Swow\\.*|\
70+
^MongoDB\\.*|\
71+
^Symfony\\.*|\
72+
^Hyperf\\(?!Contract|Validation|Context\\Context).*|\
73+
^FastRoute\\.*|\
74+
^PHPUnit\\.*
8975

9076
ruleset:
9177
Application:
@@ -95,20 +81,30 @@ deptrac:
9581
Domain:
9682
- Contract
9783
- Native
84+
Hyperf:
85+
- Domain
86+
- Contract
87+
- Native
88+
- Infrastructure
89+
- Testing
90+
- Presentation
91+
- Vendor
9892
Infrastructure:
9993
- Domain
10094
- Contract
10195
- Native
96+
- Hyperf
10297
- Vendor
103-
- Validation
10498
Presentation:
10599
- Domain
106100
- Contract
107101
- Native
108-
- Application
109102
- Infrastructure
110-
- Validation
111-
Validation:
103+
- Hyperf
104+
Testing:
112105
- Domain
113-
- Native
114106
- Contract
107+
- Native
108+
- Presentation
109+
- Hyperf
110+
- Vendor

makefile

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -45,22 +45,22 @@ dump: ## Run the composer dump
4545
lint: ## Perform code style lint
4646
@$(COMPOSE_RUNNER) run --rm --entrypoint composer app lint
4747

48-
lint-phpcs: ## Perform code style list using phpcs
48+
lint.phpcs: ## Perform code style list using phpcs
4949
@$(COMPOSE_RUNNER) run --rm --entrypoint composer app lint:phpcs
5050

51-
lint-phpstan: ## Perform code style list using phpstan
51+
lint.phpstan: ## Perform code style list using phpstan
5252
@$(COMPOSE_RUNNER) run --rm --entrypoint composer app lint:phpstan
5353

54-
lint-deptrac: ## Perform code style list using deptrac
54+
lint.deptrac: ## Perform code style list using deptrac
5555
@$(COMPOSE_RUNNER) run --rm --entrypoint composer app lint:deptrac
5656

57-
lint-phpmd: ## Perform code style list using phpmd
57+
lint.phpmd: ## Perform code style list using phpmd
5858
@$(COMPOSE_RUNNER) run --rm --entrypoint composer app lint:phpmd
5959

60-
lint-rector: ## Perform code style list using rector
60+
lint.rector: ## Perform code style list using rector
6161
@$(COMPOSE_RUNNER) run --rm --entrypoint composer app lint:rector
6262

63-
lint-psalm: ## Perform code style list using psalm
63+
lint.psalm: ## Perform code style list using psalm
6464
@$(COMPOSE_RUNNER) run --rm --entrypoint composer app lint:psalm
6565

6666
fix: ## Perform code style fix

0 commit comments

Comments
 (0)