mirror of
https://github.com/sanjeed5/awesome-cursor-rules-mdc.git
synced 2026-11-30 14:52:55 +08:00
rename folder
This commit is contained in:
@@ -0,0 +1,7 @@
|
||||
---
|
||||
description: This rule enforces code writing standards relevant to different languages.
|
||||
globs: **/*.*
|
||||
---
|
||||
- Follow Established Code-Writing Standards.
|
||||
- Know your programming language's conventions in terms of spacing, comments, and naming.
|
||||
- Consider extending some of these standards by creating internal coding rules for your organization. This can contain information on creating and naming folders or describing function names within your organization.
|
||||
@@ -0,0 +1,8 @@
|
||||
---
|
||||
description: This rule dictates how comments should be used within the codebase to enhance understanding and avoid clutter.
|
||||
globs: **/*.*
|
||||
---
|
||||
- Use comments sparingly, and when you do, make them meaningful.
|
||||
- Don't comment on obvious things. Excessive or unclear comments can clutter the codebase and become outdated.
|
||||
- Use comments to convey the "why" behind specific actions or explain unusual behavior and potential pitfalls.
|
||||
- Provide meaningful information about the function's behavior and explain unusual behavior and potential pitfalls.
|
||||
@@ -0,0 +1,6 @@
|
||||
---
|
||||
description: This rule enforces encapsulating nested conditionals into functions to improve clarity.
|
||||
globs: **/*.*
|
||||
---
|
||||
- One way to improve the readability and clarity of functions is to encapsulate nested if/else statements into other functions.
|
||||
- Encapsulating such logic into a function with a descriptive name clarifies its purpose and simplifies code comprehension.
|
||||
@@ -0,0 +1,7 @@
|
||||
---
|
||||
description: This rule enforces the Don't Repeat Yourself principle to avoid code duplication and improve maintainability.
|
||||
globs: **/*.*
|
||||
---
|
||||
- Follow the DRY (Don't Repeat Yourself) Principle and Avoid Duplicating Code or Logic.
|
||||
- Avoid writing the same code more than once. Instead, reuse your code using functions, classes, modules, libraries, or other abstractions.
|
||||
- Modify code in one place if you need to change or update it.
|
||||
+7
@@ -0,0 +1,7 @@
|
||||
---
|
||||
description: This rule enforces the single responsibility principle, ensuring functions are short and focused.
|
||||
globs: **/*.*
|
||||
---
|
||||
- Write short functions that only do one thing.
|
||||
- Follow the single responsibility principle (SRP), which means that a function should have one purpose and perform it effectively.
|
||||
- If a function becomes too long or complex, consider breaking it into smaller, more manageable functions.
|
||||
+10
@@ -0,0 +1,10 @@
|
||||
---
|
||||
description: This rule applies to all files in the project and enforces general principles of clean code, readability, and maintainability.
|
||||
globs: **/*.*
|
||||
---
|
||||
- Write code that is readable, understandable, and maintainable for future readers.
|
||||
- Aim to create software that is not only functional but also readable, maintainable, and efficient throughout its lifecycle.
|
||||
- Prioritize clarity to make reading, understanding, and modifying code easier.
|
||||
- Adhere to established coding standards and write well-structured code to reduce errors.
|
||||
- Regularly review and refactor code to improve structure, readability, and maintainability. Always leave the codebase cleaner than you found it.
|
||||
- Use version control systems (e.g., Git) to track changes and collaborate effectively.
|
||||
@@ -0,0 +1,7 @@
|
||||
---
|
||||
description: This rule focuses on using meaningful and descriptive names for variables, functions, and classes throughout the project.
|
||||
globs: **/*.*
|
||||
---
|
||||
- Choose names for variables, functions, and classes that reflect their purpose and behavior.
|
||||
- A name should tell you why it exists, what it does, and how it is used. If a name requires a comment, then the name does not reveal its intent.
|
||||
- Use specific names that provide a clearer understanding of what the variables represent and how they are used.
|
||||
Reference in New Issue
Block a user