|
@@ -0,0 +1,28 @@
|
|
|
+---
|
|
|
+description: writing code
|
|
|
+globs: *.py
|
|
|
+alwaysApply: false
|
|
|
+---
|
|
|
+# Coding Style
|
|
|
+
|
|
|
+- Always prefer simple solutions
|
|
|
+- Avoid having files over 200-300 lines of code. Refactor at that point
|
|
|
+- Use single quotes for strings in Python
|
|
|
+- Use f-strings wherever possible for better readability (except in performance-critical sections which should be marked with "NOTE:" comments)
|
|
|
+- Follow autopep8 formatting with 120 character line length
|
|
|
+- Each sentence in documentation should be on a new line
|
|
|
+- Use ruff for linting and code checks
|
|
|
+
|
|
|
+# Workflow
|
|
|
+
|
|
|
+- Never overwrite .env file without first asking and confirming
|
|
|
+- Avoid duplication of code whenever possible, which means checking for other areas of the codebase that might already have similar code and functionality
|
|
|
+- Be careful to only make changes that are requested or are well understood and related to the change being requested
|
|
|
+- When fixing an issue or bug, do not introduce a new pattern or technology without first exhausting all options for the existing implementation. And if you finally do this, make sure to remove the old implementation afterwards so we don't have duplicate logic
|
|
|
+- Keep the codebase very clean and organized
|
|
|
+- Write tests for new features
|
|
|
+- Run tests before submitting any changes
|
|
|
+- Format code using autopep8 before submitting changes
|
|
|
+- Use pre-commit hooks to ensure coding style compliance
|
|
|
+- When adding new features, include corresponding tests
|
|
|
+- For documentation changes, ensure each sentence is on a new line
|