Feed this to your AI to have your code tidy and awesome.
- Line Length: maximum 100 characters
- 1 blank line: between functions, methods, classes, after imports
- 2 blank lines: between logical sections, after docstrings, at end of every file
- Classes, Functions, Methods: UpperCamelCase
- Variables, Members: lowerCamelCase
- Constants: UPPER_SNAKE_CASE
- Use triple double-quotes, keeping them short and focused
- Only document args and returns if not intuitive from the function name and types
- Each logical block should have a descriptive comment
- Explain "why" not "what"
- Keep up-to-date with code changes
- Required for function parameters and return values
- Use built-in types when possible, use
collections.abc
for container types
- One class per file (with rare exceptions)
- Group related functionality
- Keep methods focused and single-purpose
- Break long functions into smaller pieces
- Include descriptive error messages, with possible solutions