Repository navigation
Expand file tree
/
Copy pathlefthook.yml
More file actions
41 lines (40 loc) · 1.52 KB
/
Copy pathlefthook.yml
File metadata and controls
41 lines (40 loc) · 1.52 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
pre-commit:
parallel: true
commands:
# Generated files are formatted by the generator, never by pint: pint given explicit paths
# ignores the exclude list in pint.json, and a reformatted generated file is drift on CI.
pint:
glob: "*.php"
exclude:
- src/Generated/**
- src/ErrorCode.php
- src/Roxy.php
- src/Version.php
run: vendor/bin/pint {staged_files}
stage_fixed: true
docs-sync:
glob: "{specs/openapi.json,scripts/namespace.mjs,scripts/tag-descriptions.mjs,scripts/sync-docs.mjs}"
run: node scripts/sync-docs.mjs && git add README.md AGENTS.md
stage_fixed: true
pre-push:
parallel: false
commands:
pint:
run: vendor/bin/pint --test
priority: 1
phpstan:
run: vendor/bin/phpstan analyse --no-progress --memory-limit=512M
priority: 2
# Hermetic: regenerates from the committed spec, so this verifies the committed code still
# reproduces from it, with no network dependency. Refreshing the spec is the release job.
# generate.mjs also runs sync-docs.mjs, so README.md and AGENTS.md are asserted in the same diff.
codegen-drift:
env:
ROXYAPI_SPEC_FILE: specs/openapi.json
run: >-
node scripts/generate.mjs && git diff --exit-code -- specs/openapi.json src/Generated src/ErrorCode.php src/Roxy.php src/Version.php README.md AGENTS.md
|| { echo 'codegen drift: commit the regenerated files'; exit 1; }
priority: 3
test:
run: vendor/bin/pest
priority: 4