Add Coding Conventions and Formatting Rules
Define coding conventions and formatting rules for the RenPy Translator project to ensure code consistency and maintainability.
Consistent formatting improves readability and reduces unnecessary style discussions during development.
Tools
The project will use the following tools:
- Black – automatic code formatter
- Ruff – fast Python linter
- isort – import sorting
Tasks
Formatting Rules
General conventions:
- Use Black default formatting
- Maximum line length: 88 characters
- Use snake_case for variables and functions
- Use PascalCase for classes
- Keep functions small and readable
Example:
def extract_dialogues(file_path: str) -> list:
"""Extract dialogue lines from a Ren'Py script file."""
pass
Goal
Ensure all code in the repository follows a consistent style and is automatically formatted.