Update Cursor rules: add gitkeep handling, update gitignore guidance, and fill empty rule files
This commit is contained in:
parent
1dde4ddb57
commit
dfe71e35eb
|
@ -1,5 +0,0 @@
|
|||
---
|
||||
description:
|
||||
globs:
|
||||
alwaysApply: false
|
||||
---
|
|
@ -1,5 +1,38 @@
|
|||
---
|
||||
description:
|
||||
globs:
|
||||
description:
|
||||
globs:
|
||||
alwaysApply: false
|
||||
---
|
||||
# Gitignore Rules
|
||||
|
||||
The [.gitignore](mdc:.gitignore) file controls which files are tracked by Git.
|
||||
|
||||
## Key Patterns
|
||||
|
||||
- Cruft files (temporary/generated files) should always be ignored
|
||||
- The `./temp` directory should exist in the repository
|
||||
- Contents of `./temp` should be ignored (except for `.gitkeep`)
|
||||
|
||||
## Standard Cruft Files to Ignore
|
||||
|
||||
- `*.log` - Log files
|
||||
- `*.tmp`, `*.bak` - Temporary and backup files
|
||||
- `*.swp`, `*.swo` - Vim swap files
|
||||
- `*.pyc`, `__pycache__/` - Python bytecode
|
||||
- `node_modules/` - Node.js dependencies
|
||||
- `dist/`, `build/` - Build output directories
|
||||
- `*.DS_Store`, `Thumbs.db` - OS-specific files
|
||||
|
||||
## Temp Directory Setup
|
||||
|
||||
```gitignore
|
||||
# Allow temp directory but ignore its contents
|
||||
./temp/*
|
||||
!./temp/.gitkeep
|
||||
```
|
||||
|
||||
## Important Guidelines
|
||||
|
||||
- When adding files to a previously empty directory with a `.gitkeep`, remove the `.gitkeep` file
|
||||
- Never commit sensitive data, temporary build artifacts, or large binary files
|
||||
- Keep the temp directory clean by only using it for local testing
|
||||
|
|
|
@ -0,0 +1,47 @@
|
|||
---
|
||||
description:
|
||||
globs:
|
||||
alwaysApply: false
|
||||
---
|
||||
# .gitkeep File Handling
|
||||
|
||||
## Purpose of .gitkeep
|
||||
|
||||
The `.gitkeep` file is a convention (not a Git feature) used to:
|
||||
- Track otherwise empty directories in Git
|
||||
- Ensure important directory structures are maintained
|
||||
- Placeholder for directories that will contain files in the future
|
||||
|
||||
## Important Rule
|
||||
|
||||
**When adding content to a directory that contains a `.gitkeep` file, you should delete the `.gitkeep` file.**
|
||||
|
||||
```bash
|
||||
# Example workflow when adding content to a previously empty directory
|
||||
# 1. Check if .gitkeep exists
|
||||
if [ -f directory/.gitkeep ]; then
|
||||
# 2. Remove it when adding actual content
|
||||
rm directory/.gitkeep
|
||||
fi
|
||||
|
||||
# 3. Add your files
|
||||
touch directory/your-new-file.txt
|
||||
|
||||
# 4. Commit both changes together
|
||||
git add directory/
|
||||
git commit -m "Add content to directory and remove .gitkeep"
|
||||
```
|
||||
|
||||
## Why Remove .gitkeep?
|
||||
|
||||
- `.gitkeep` serves no purpose once a directory contains files
|
||||
- Leaving it creates confusion about the directory's status
|
||||
- Proper cleanup maintains a clean repository
|
||||
|
||||
## Locations with .gitkeep
|
||||
|
||||
In this project, the following locations may contain `.gitkeep` files:
|
||||
- [temp/.gitkeep](mdc:temp/.gitkeep) - Keeps the temp directory in the repo
|
||||
- [docker/template/src/.gitkeep](mdc:docker/template/src/.gitkeep) - Keeps the source directory in the repo
|
||||
|
||||
Always check for `.gitkeep` when adding files to these directories and remove it if found.
|
Loading…
Reference in New Issue