From dfe71e35ebccdcc2615bd8f7f2fac6f07271cf74 Mon Sep 17 00:00:00 2001 From: Leopere Date: Wed, 23 Apr 2025 10:14:38 -0400 Subject: [PATCH] Update Cursor rules: add gitkeep handling, update gitignore guidance, and fill empty rule files --- .cursor/rules/ci-pipeline.mdc | 5 ---- .cursor/rules/gitignore.mdc | 37 +++++++++++++++++++++-- .cursor/rules/gitkeep-handling.mdc | 47 ++++++++++++++++++++++++++++++ 3 files changed, 82 insertions(+), 7 deletions(-) delete mode 100644 .cursor/rules/ci-pipeline.mdc create mode 100644 .cursor/rules/gitkeep-handling.mdc diff --git a/.cursor/rules/ci-pipeline.mdc b/.cursor/rules/ci-pipeline.mdc deleted file mode 100644 index b93c988..0000000 --- a/.cursor/rules/ci-pipeline.mdc +++ /dev/null @@ -1,5 +0,0 @@ ---- -description: -globs: -alwaysApply: false ---- diff --git a/.cursor/rules/gitignore.mdc b/.cursor/rules/gitignore.mdc index b93c988..d839a6e 100644 --- a/.cursor/rules/gitignore.mdc +++ b/.cursor/rules/gitignore.mdc @@ -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 diff --git a/.cursor/rules/gitkeep-handling.mdc b/.cursor/rules/gitkeep-handling.mdc new file mode 100644 index 0000000..5385427 --- /dev/null +++ b/.cursor/rules/gitkeep-handling.mdc @@ -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.