Skip to content

Commit d609635

Browse files
committed
Add Cursor rules
1 parent 8814db3 commit d609635

File tree

4 files changed

+44
-3
lines changed

4 files changed

+44
-3
lines changed

.cursor/rules/coding-guide.mdc

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
---
2+
description: Code in Python and Cython
3+
globs:
4+
alwaysApply: false
5+
---
6+
- Follow PEP 8 rules
7+
- When you write imports, split system, 3rd-party, and local imports with a new line
8+
- Have two empty lines between the import block and the rest of the code
9+
- Have an empty line (\n) at the end of every file
10+
- If a file is supposed to be run, always add ``if __name__ == 'main'``
11+
- Always follow a consistent pattern of using double or single quotes
12+
- When there is a class without a docblock, leave one blank line before its members, e.g.:
13+
```python
14+
class Container(containers.DeclarativeContainer):
15+
16+
service = providers.Factory(Service)
17+
```
18+
19+
- Avoid shortcuts in names unless absolutely necessarry, exceptions:
20+
```
21+
arg
22+
args
23+
kwarg
24+
kwargs
25+
obj
26+
cls
27+
```
28+
29+
- Avoid inline comments unless absolutely necessarry

.cursor/rules/makefile-commands.mdc

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
---
2+
description: Build and run tests
3+
globs:
4+
alwaysApply: false
5+
---
6+
- Use Makefile commands to build, test, lint and other similar operations when they are available.
7+
- Activate virtualenv before running any commands by ``. venv/bin/actvate``

.cursor/rules/run-examples.mdc

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
---
2+
description: Run examples
3+
globs:
4+
alwaysApply: false
5+
---
6+
- When you run an example from the ``examples/`` folder, switch to the example folder and run it from there.
7+
- If there are instructions on running the examples or its tests in readme, follow them
8+
- Activate virtualenv before running any commands by ``. venv/bin/actvate``

.gitignore

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,3 @@ src/**/*.html
7373
.workspace/
7474

7575
.vscode/
76-
77-
# Cursor project files
78-
.cursor

0 commit comments

Comments
 (0)