Skip to content

Commit 1054915

Browse files
committed
Release v2.0.31: REQ-GIT-001 git hygiene, Code of Conduct, and CI docs.
1 parent 531ab10 commit 1054915

21 files changed

Lines changed: 718 additions & 6 deletions

.cursor/rules/00-global.mdc

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
---
2+
description: Global rules for Symfony bundle repository
3+
alwaysApply: true
4+
---
5+
6+
Assume this repository is a reusable Symfony bundle.
7+
8+
Prefer:
9+
- minimal, local changes
10+
- starting with files already open or explicitly mentioned
11+
- the smallest viable patch first
12+
- preserving backward compatibility unless explicitly requested otherwise
13+
14+
Do not scan the whole repository unless explicitly required.
15+
Do not read vendor, cache, generated, build, coverage, lock, or binary files unless strictly needed for the task (for example dependency/release sync).

.cursor/rules/01-git-commits.mdc

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
---
2+
description: Git commit message rules for this repository
3+
alwaysApply: true
4+
---
5+
6+
When creating git commits in this repository:
7+
8+
- NEVER add `Co-authored-by: Cursor` or any Cursor agent co-author trailer to commit messages.
9+
- NEVER add `Co-authored-by: cursoragent@cursor.com` or similar Cursor attribution lines.
10+
- Commit messages must list only human authors; tooling attribution belongs in PR descriptions or release notes, not in git trailers.
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
---
2+
description: PHP and Symfony bundle rules
3+
globs:
4+
- "src/**/*.php"
5+
- "config/**/*.php"
6+
- "config/**/*.yaml"
7+
- "config/**/*.yml"
8+
alwaysApply: false
9+
---
10+
11+
Target this bundle compatibility by default: PHP >=8.1 and Symfony 6/7/8.
12+
13+
Prefer:
14+
- modern PHP with strict typing and explicit return types
15+
- PSR-12 coding style
16+
- final classes by default
17+
- readonly where appropriate
18+
- constructor injection
19+
- small focused services
20+
- framework conventions over custom abstractions
21+
- preserving public extension points
22+
- keeping DI extension, compiler pass wiring, and form type options backward compatible
23+
- PHPDoc in English for non-trivial classes, methods, and complex behavior
24+
25+
Do not introduce BC breaks unless explicitly requested.
26+
Do not add PHPDoc in Spanish.
27+
Do not rename public services, configuration keys, or Twig integrations without warning.
28+
Do not touch unrelated namespaces or files.
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
---
2+
description: Twig templates and public bundle assets
3+
globs:
4+
- "templates/**/*.twig"
5+
- "src/**/Resources/views/**/*.twig"
6+
- "src/Resources/public/**/*"
7+
alwaysApply: false
8+
---
9+
10+
Prefer:
11+
- small, backward-compatible template and public asset changes
12+
- preserving current block structure
13+
- local DOM updates
14+
- reusing existing classes, ids, and hooks
15+
- minimal asset changes
16+
17+
Do not edit generated files inside src/Resources/public/build.
18+
Do not rewrite entire templates or public asset trees for a local change.

.cursor/rules/40-tests-quality.mdc

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
---
2+
description: Tests and quality rules
3+
globs:
4+
- "tests/**/*.php"
5+
- "tests/**/*.ts"
6+
- "tests/**/*.js"
7+
- "src/Resources/assets/**/*.test.ts"
8+
- "src/Resources/assets/**/*.spec.ts"
9+
- "src/Resources/assets/**/*.test.js"
10+
- "src/Resources/assets/**/*.spec.js"
11+
- "phpunit.xml*"
12+
- "vitest.config.*"
13+
- "eslint.config.*"
14+
alwaysApply: false
15+
---
16+
17+
When changing behavior, prefer adding or updating the nearest relevant test.
18+
19+
Prefer:
20+
- one focused test
21+
- minimal fixture changes
22+
- preserving the existing testing style
23+
- test updates close to the changed behavior
24+
25+
Do not introduce new testing frameworks unless explicitly requested.
26+
Do not rewrite unrelated tests.
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
---
2+
description: Documentation and release notes rules
3+
globs:
4+
- "README.md"
5+
- "docs/**/*.md"
6+
alwaysApply: false
7+
---
8+
9+
Prefer:
10+
- documentation updates aligned with real code changes and current compatibility ranges
11+
- concise, actionable release notes
12+
- updating CHANGELOG and UPGRADING together for notable user-facing changes
13+
- preserving existing document structure and tone
14+
- keeping examples consistent with actual defaults and routes in this bundle
15+
16+
Do not invent features, versions, or commands that are not present in the repository.
17+
Do not remove past release history unless explicitly requested.

.cursorignore

Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
# Dependencies
2+
/vendor/
3+
/node_modules/
4+
5+
# Symfony runtime
6+
/var/
7+
8+
# Build outputs
9+
/dist/
10+
/build/
11+
/coverage/
12+
/.vite/
13+
/.storybook-static/
14+
15+
# Bundle public generated assets
16+
/src/Resources/public/build/
17+
18+
# Caches / analysis
19+
/.php-cs-fixer.cache
20+
/.phpstan.cache
21+
/.psalm/
22+
.phpstan.result.cache
23+
/phpunit.xml.cache
24+
/.phpunit.cache/
25+
26+
# Package manager locks
27+
pnpm-lock.yaml
28+
package-lock.json
29+
yarn.lock
30+
composer.lock
31+
32+
# IDE / local
33+
/.idea/
34+
/.vscode/
35+
/.env
36+
/.env.*
37+
!.env.example
38+
39+
# Heavy / binary / logs
40+
*.log
41+
*.sql
42+
*.sql.gz
43+
*.csv
44+
*.xlsx
45+
*.pdf
46+
*.zip
47+
*.tar
48+
*.gz
49+
*.mp4
50+
*.mov
51+
*.webm
52+
53+
# Secrets
54+
*.pem
55+
*.key
56+
*.p12

.githooks/commit-msg

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
#!/usr/bin/env sh
2+
# Strip Cursor agent co-author trailers from commit messages (REQ-GIT-001).
3+
set -eu
4+
5+
MSG_FILE="${1:?commit message file required}"
6+
tmp="$(mktemp)"
7+
8+
sed -e '/^Co-authored-by: Cursor <cursoragent@cursor.com>$/d' \
9+
-e '/^Co-authored-by:.*cursoragent@cursor\.com/d' \
10+
"$MSG_FILE" > "$tmp"
11+
12+
mv "$tmp" "$MSG_FILE"
13+
exit 0

.githooks/pre-commit

100644100755
File mode changed.

.github/workflows/ci.yml

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,20 @@ on:
88
branches: [main, master]
99

1010
jobs:
11+
git-hygiene:
12+
name: Git history (no Cursor co-author)
13+
runs-on: ubuntu-latest
14+
steps:
15+
- name: Checkout code
16+
uses: actions/checkout@v6
17+
with:
18+
fetch-depth: 0
19+
20+
- name: Check for Cursor co-author trailers (REQ-GIT-001)
21+
run: |
22+
chmod +x .scripts/check-no-cursor-coauthor.sh
23+
./.scripts/check-no-cursor-coauthor.sh HEAD
24+
1125
test:
1226
name: PHP ${{ matrix.php }} - Symfony ${{ matrix.symfony }}
1327
runs-on: ubuntu-latest

0 commit comments

Comments
 (0)