Contributing¶
We welcome contributions to janito! This guide explains how to get involved.
Getting Started¶
- Fork the repository on GitHub
-
Clone your fork locally:
-
Create a feature branch:
-
Set up development environment:
-
Make your changes and test them
-
Run tests:
-
Commit your changes:
-
Push to your fork:
-
Open a Pull Request on GitHub
Code Guidelines¶
Python Style¶
- Use 4 spaces for indentation
- Follow PEP 8 conventions
- Add type hints for function parameters and return values
- Write docstrings for all public functions and classes
Example¶
def greet_user(name: str, greeting: str = "Hello") -> str:
"""
Generate a greeting message for a user.
Args:
name: The user's name
greeting: The greeting word (default: "Hello")
Returns:
A formatted greeting string
"""
return f"{greeting}, {name}!"
Testing¶
- Write tests for new features
- Ensure all tests pass before submitting
- Aim for meaningful test coverage
def test_greet_user():
result = greet_user("Alice")
assert result == "Hello, Alice!"
def test_greet_user_custom_greeting():
result = greet_user("Bob", greeting="Hi")
assert result == "Hi, Bob!"
Types of Contributions¶
Bug Fixes¶
- Describe the bug in detail
- Provide steps to reproduce
- Include test cases if applicable
Features¶
- Explain the feature and its use case
- Provide examples of usage
- Consider backward compatibility
Documentation¶
- Fix typos or unclear explanations
- Add examples or tutorials
- Translate or localize documentation
Code Quality¶
- Refactor for clarity or performance
- Add type hints
- Improve test coverage
Reporting Issues¶
When reporting issues, please include:
- Your operating system and version
- Python version
- janito version
- Steps to reproduce
- Expected vs actual behavior
- Error messages or logs
Questions?¶
Feel free to open an issue for questions or discussions.
License¶
By contributing, you agree that your contributions will be licensed under the MIT License.