First off, thank you for considering contributing to the Overtime app! It's people like you that make this project better for everyone.
- Code of Conduct
- Getting Started
- How Can I Contribute?
- Development Setup
- Style Guidelines
- Commit Messages
- Testing
- Documentation
This project and everyone participating in it is governed by the Code of Conduct. By participating, you are expected to uphold this code. Please report unacceptable behavior to ar.frappe.dev@gmail.com.
Before you begin:
- Make sure you have a GitHub account
- Check if an issue already exists for what you want to work on
- Fork the repository to your own GitHub account
- Clone the fork to your local machine
Before creating bug reports, please check the existing issues as you might find that you don't need to create one. When you are creating a bug report, please include as many details as possible.
Before Submitting A Bug Report:
- Check the troubleshooting section in the README
- Verify you're using the latest version of the app
- Search existing issues to see if the problem has already been reported
How Do I Submit A (Good) Bug Report?
Bugs are tracked as GitHub issues. Create an issue and provide the following information:
- Use a clear and descriptive title
- Describe the exact steps to reproduce the problem
- Provide specific examples (include code snippets, log output, screenshots)
- Describe the behavior you observed and what you expected
- Include your environment details:
- Frappe version
- HRMS version
- Python version
- Browser (if applicable)
Enhancement suggestions are tracked as GitHub issues. When creating an enhancement suggestion, please include:
- Use a clear and descriptive title
- Provide a step-by-step description of the suggested enhancement
- Explain why this enhancement would be useful
- List any alternatives you've considered
The process described here aims to:
- Maintain the project's quality
- Fix problems that are important to users
- Engage the community in working toward the best possible product
Please follow these steps:
- Fork the repository and create your branch from
develop - If you've added code, add tests that cover your changes
- If you've changed APIs, update the documentation
- Ensure the test suite passes
- Make sure your code follows the style guidelines
- Issue your pull request
- Python 3.10+
- Frappe Bench v15+
- HRMS v15 installed
# 1. Fork and clone the repository
git clone https://github.com/YOUR_USERNAME/overtime.git
# 2. Add the app to your bench
cd ~/frappe-bench
bench get-app /path/to/overtime
# 3. Install the app on your site
bench --site your-site.local install-app overtime
# 4. Install pre-commit hooks
cd apps/overtime
pip install pre-commit
pre-commit install
# 5. Create a new branch for your changes
git checkout -b feature/your-feature-name# Start the development server
bench start
# Or run specific services
bench serve # Web server
bench watch # Watch for file changesWe use ruff for linting and formatting Python code.
# Run ruff linter
ruff check .
# Run ruff formatter
ruff format .
# Fix import sorting
ruff check --select=I --fix .Key Guidelines:
- Use tabs for indentation (Frappe convention)
- Maximum line length: 110 characters
- Use double quotes for strings
- Follow PEP 8 naming conventions
We use ESLint and Prettier for JavaScript.
# Run ESLint
npx eslint .
# Run Prettier
npx prettier --write .All code style checks run automatically via pre-commit hooks:
# Install hooks
pre-commit install
# Run manually on all files
pre-commit run --all-filesWe follow the Conventional Commits specification:
<type>(<scope>): <description>
[optional body]
[optional footer(s)]
Types:
feat: A new featurefix: A bug fixdocs: Documentation only changesstyle: Code style changes (formatting, missing semicolons, etc.)refactor: Code change that neither fixes a bug nor adds a featureperf: Performance improvementstest: Adding missing tests or correcting existing testschore: Changes to the build process or auxiliary tools
Examples:
feat(shift-rule): add support for custom rate multipliers per department
fix(overnight): correctly calculate hours when shift crosses midnight
docs: update installation instructions for v15
refactor(utils): simplify overtime calculation logic
# Run all tests
bench --site your-site.local run-tests --app overtime
# Run specific test file
bench --site your-site.local run-tests --module overtime.overtime.doctype.overtime_entry.test_overtime_entry
# Run with verbose output
bench --site your-site.local run-tests --app overtime -v- Place tests in
test_*.pyfiles alongside the module being tested - Use Frappe's
FrappeTestCaseas the base class - Include both positive and negative test cases
- Test edge cases (overnight shifts, Ramadan period, etc.)
Example:
import frappe
from frappe.tests.utils import FrappeTestCase
class TestOvertimeEntry(FrappeTestCase):
def setUp(self):
# Setup test data
pass
def test_overtime_calculation(self):
# Test implementation
result = calculate_overtime(...)
self.assertEqual(result, expected_value)- Update the README.md for user-facing changes
- Add docstrings to new functions and classes
- Update the CHANGELOG.md for notable changes
Use Google-style docstrings:
def calculate_overtime(attendance, shift_rule):
"""Calculate overtime hours for an attendance record.
Args:
attendance: The Attendance document.
shift_rule: The matched Overtime Shift Rule.
Returns:
float: The calculated overtime hours.
Raises:
ValueError: If attendance has no checkin records.
"""
passIf you have questions about contributing, feel free to open an issue with the question label or reach out to the maintainers.
Thank you for contributing! 🎉