-
Notifications
You must be signed in to change notification settings - Fork 126
Expand file tree
/
Copy path.cursorrules
More file actions
40 lines (34 loc) · 1.88 KB
/
.cursorrules
File metadata and controls
40 lines (34 loc) · 1.88 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
# Cursor Rules for BioNeMo Framework
## Pre-commit and Linting
1. **Always run pre-commit hooks after making changes:**
- After editing any file, run `pre-commit run --all-files` or `pre-commit run` to check modified files
- If pre-commit hooks fail, fix the issues before considering the task complete
- Pre-commit hooks include:
- Ruff linting and formatting (with auto-fix)
- Markdown formatting
- License header checks
- Trailing whitespace and end-of-file fixes
- YAML validation
- Secret detection
2. **Fix linter errors immediately:**
- When making code changes, check for linter errors using `read_lints` tool
- Fix all linter errors before completing the task
- The project uses:
- Ruff for Python linting and formatting (configured in pyproject.toml)
- Pyright for type checking (configured in pyproject.toml)
- Ruff will auto-fix many issues, but you should verify all fixes are appropriate
3. **Code quality standards:**
- Follow the project's ruff configuration (line-length: 119, specific ignores)
- Ensure all Python files follow Google-style docstrings (pydocstyle convention)
- Import sorting follows isort configuration (2 lines after imports)
- Test files and `__init__.py` files have relaxed linting rules as configured
4. **Workflow:**
- Make code changes
- Check for linter errors with `read_lints`
- Fix any linter errors
- Run pre-commit: `pre-commit run --all-files` or `pre-commit run` for changed files
- If pre-commit fails, fix the issues and re-run until all checks pass
- Only mark a task as complete when all linter errors are resolved and pre-commit passes
5. **Exceptions:**
- If a linting rule genuinely conflicts with the required change or is a false positive, document why in comments
- Some files may have per-file ignores configured in pyproject.toml - respect those configurations