mirror of
https://github.com/HKUDS/DeepTutor.git
synced 2026-12-04 07:09:38 +08:00
3.5 KiB
3.5 KiB
Contributing to DeepTutor
Thank you for your interest in contributing to DeepTutor! We are trying to make DeepTutor smooth and robust, for every developers to develop and conribute.
Join our community for discussion and support:
⚠️ Contribution Requirements
Important
All contributions must be based on the
devbranch!
- Fork the repository and clone it locally
- Always pull from the
devbranch:git checkout dev && git pull origin dev- Create your feature branch from
dev:git checkout -b feature/your-feature- Submit your PR to the
devbranch (NOTmain)- Ensure all pre-commit checks pass before submitting
🛠️ Code Quality
We use automated tools to maintain code quality:
- Ruff — Python linting & formatting (
pyproject.toml) - Prettier — Frontend formatting (
web/.prettierrc.json) - detect-secrets — Security scanning
Important
Before submitting a PR, you MUST run:
pre-commit run --all-filesCI will automatically check this and reject PRs that fail pre-commit checks.
Setting Up Pre-commit (First Time Only)
Step 1: Install pre-commit
# Using pip
pip install pre-commit
# Or using conda
conda install -c conda-forge pre-commit
Step 2: Install Git hooks (recommended)
cd DeepTutor
pre-commit install
After this, hooks will run automatically on every commit — no need to remember!
Step 3: Run checks on all files
pre-commit run --all-files
Common Commands
# Normal commit (hooks run automatically if installed)
git commit -m "Your commit message"
# Manually check all files (do this before pushing!)
pre-commit run --all-files
# Update hooks to latest versions
pre-commit autoupdate
# Skip hooks (not recommended, only for emergencies)
git commit --no-verify -m "Emergency fix"
📋 Commit Message Format
<type>: <short description>
[optional body]
[optional footer(s)]
Types: feat, fix, docs, style, refactor, test, chore
Examples:
feat: for a new feature. This typically corresponds to a MINOR version bump in Semantic Versioning.fix: for a bug fix. This typically corresponds to a PATCH version bump.chore: for routine tasks that do not modify source code or tests (e.g., updating build processes).docs: for documentation-only changes.style: for changes that do not affect the meaning of the code (e.g., whitespace, semicolons).refactor: for code changes that neither fix a bug nor add a feature.test: for adding missing tests or correcting existing tests.
💡 How to Get Started
- Check our Issues for tasks labeled
good first issueorhelp wanted - Comment on the issue you'd like to work on
- Follow the contribution process above
- Join our Discord if you have questions!