From 9a8641ca9c50c0bda6c7dcc23d3b6b15ce9ed803 Mon Sep 17 00:00:00 2001 From: Tony Narlock Date: Thu, 20 Feb 2025 19:14:56 -0600 Subject: [PATCH 1/3] docs(cursor[rules]) Add dev-loop rule See also: https://docs.cursor.com/context/rules-for-ai --- .cursor/rules/dev-loop.mdc | 37 +++++++++++++++++++++++++++++++++++++ 1 file changed, 37 insertions(+) create mode 100644 .cursor/rules/dev-loop.mdc diff --git a/.cursor/rules/dev-loop.mdc b/.cursor/rules/dev-loop.mdc new file mode 100644 index 00000000..1886aa70 --- /dev/null +++ b/.cursor/rules/dev-loop.mdc @@ -0,0 +1,37 @@ +--- +description: QA every edit +globs: *.py +--- + +# First: QA Every edit + +Run these commands between edits: + +Check typings: + +``` +uv run mypy +``` + +Lint: + +``` +uv run ruff check . --fix; uv run ruff format .; +``` + +Check tests: + +``` +uv run py.test +``` + +Between every edit, rerun: +- Type checks +- Lint +- Tests + +If there's any failures *due to the edits*, fix them first, then: + +# When your edit is complete: Commit it + +Make an atomic commit for the edit, using conventional commits. From 00118ace6ee8b33e19811a274ece2f73f46845f4 Mon Sep 17 00:00:00 2001 From: Tony Narlock Date: Sat, 22 Feb 2025 11:54:29 -0600 Subject: [PATCH 2/3] docs(cursor[rules]): Add git commit message standards why: Establish clear conventions for commit messages and AI assistance what: - Created git-commits.mdc with commit format guidelines - Added commit type definitions and examples - Included instructions for using Cursor's AI commit features - Documented best practices for commit message structure See also: https://docs.cursor.com/context/rules-for-ai --- .cursor/rules/git-commits.mdc | 63 +++++++++++++++++++++++++++++++++++ 1 file changed, 63 insertions(+) create mode 100644 .cursor/rules/git-commits.mdc diff --git a/.cursor/rules/git-commits.mdc b/.cursor/rules/git-commits.mdc new file mode 100644 index 00000000..e3315316 --- /dev/null +++ b/.cursor/rules/git-commits.mdc @@ -0,0 +1,63 @@ +--- +description: git-commits: Git commit message standards and AI assistance +globs: git-commits: Git commit message standards and AI assistance | *.git/* .gitignore .github/* CHANGELOG.md CHANGES.md +--- +# Git Commit Standards + +## Format +``` +type(scope[component]): concise description + +why: explanation of necessity/impact +what: +- technical changes made +- keep focused on single topic + +refs: #issue-number, breaking changes, links +``` + +## Commit Types +- `feat`: New features/enhancements +- `fix`: Bug fixes +- `refactor`: Code restructuring +- `docs`: Documentation changes +- `chore`: Maintenance tasks (deps, tooling) +- `test`: Test-related changes +- `style`: Code style/formatting + +## Guidelines +- Subject line: max 50 chars +- Body lines: max 72 chars +- Use imperative mood ("Add" not "Added") +- Single topic per commit +- Blank line between subject and body +- Mark breaking changes with "BREAKING:" +- Use "See also:" for external links + +## AI Assistance in Cursor +- Stage changes with `git add` +- Use `@commit` to generate initial message +- Review and adjust the generated message +- Ensure it follows format above + +## Examples + +Good commit: +``` +feat(subprocess[run]): Switch to unicode-only text handling + +why: Improve consistency and type safety in subprocess handling +what: +- BREAKING: Changed run() to use text=True by default +- Removed console_to_str() helper and encoding logic +- Simplified output handling +- Updated type hints for better safety + +refs: #485 +See also: https://docs.python.org/3/library/subprocess.html +``` + +Bad commit: +``` +updated some stuff and fixed bugs +``` \ No newline at end of file From c3ec643a7a4f19202cbd9975617a1b4203c1ee29 Mon Sep 17 00:00:00 2001 From: Tony Narlock Date: Sat, 22 Feb 2025 17:20:16 -0600 Subject: [PATCH 3/3] docs(CHANGES) Note cursor rules --- .cursor/rules/git-commits.mdc | 21 ++++++++++++++++++++- CHANGES | 4 ++++ 2 files changed, 24 insertions(+), 1 deletion(-) diff --git a/.cursor/rules/git-commits.mdc b/.cursor/rules/git-commits.mdc index e3315316..0a5fa118 100644 --- a/.cursor/rules/git-commits.mdc +++ b/.cursor/rules/git-commits.mdc @@ -60,4 +60,23 @@ See also: https://docs.python.org/3/library/subprocess.html Bad commit: ``` updated some stuff and fixed bugs -``` \ No newline at end of file +``` + +Cursor Rules: Add development QA and git commit standards (#cursor-rules) + +- Add dev-loop.mdc: QA process for code edits + - Type checking with mypy + - Linting with ruff + - Test validation with pytest + - Ensures edits are validated before commits + +- Add git-commits.mdc: Commit message standards + - Structured format with why/what sections + - Defined commit types and guidelines + - Examples of good/bad commits + - AI assistance instructions + +Note: These rules help maintain code quality and commit history +consistency across the project. + +See also: https://docs.cursor.com/context/rules-for-ai \ No newline at end of file diff --git a/CHANGES b/CHANGES index fa2db7fd..64c7c3cd 100644 --- a/CHANGES +++ b/CHANGES @@ -15,6 +15,10 @@ $ pip install --user --upgrade --pre libvcs +### Development + +- Cursor rules for development loop and git commit messages (#488) + ## libvcs 0.35.0 (2025-02-22) ### Breaking changes