From 216cb32e7cf01c00662522f9e8e5896baf59ce16 Mon Sep 17 00:00:00 2001 From: Chinhpl Date: Tue, 27 May 2025 14:06:55 +0900 Subject: [PATCH] Create rule.txt --- rule.txt | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) create mode 100644 rule.txt diff --git a/rule.txt b/rule.txt new file mode 100644 index 000000000000..cc63019f275a --- /dev/null +++ b/rule.txt @@ -0,0 +1,23 @@ +### ✅ **Python Code Conventions (PEP 8 Overview)** + +1. **Indentation**: Use 4 spaces per indentation level. +2. **Line Length**: Limit lines to 79 characters. +3. **Blank Lines**: Use blank lines to separate functions and classes. +4. **Imports**: + + * Standard libraries first, third-party next, then local. + * One import per line. +5. **Naming Conventions**: + + * `snake_case` for variables and functions. + * `CamelCase` for classes. + * `UPPER_CASE` for constants. +6. **Whitespace**: + + * Avoid extra spaces inside parentheses, brackets, or before commas. +7. **Comments**: + + * Use inline comments sparingly. + * Use docstrings (`"""Example"""`) for modules, functions, classes. +8. **Python version**: + * use python 3.5.2