This document describes the PR submission guidelines for the Himarket project.
type: brief description
or with scope:
type(scope): brief description
| Type | Description | Example |
|---|---|---|
feat |
New feature | feat: add user authentication |
fix |
Bug fix | fix: resolve memory leak |
docs |
Documentation | docs: update API documentation |
style |
Code formatting | style: format with prettier |
refactor |
Code refactoring | refactor: simplify service logic |
perf |
Performance | perf: optimize queries |
test |
Testing | test: add unit tests |
build |
Build system | build: update dependencies |
ci |
CI/CD | ci: add workflow |
chore |
Other changes | chore: update gitignore |
revert |
Revert commit | revert: revert commit abc123 |
- ✅ Must include type prefix
- ✅ Colon and space after type:
feat:notfeat: - ✅ Description must start with lowercase letter
- ✅ Keep it brief and clear (recommended < 50 characters)
✅ feat: add product feature configuration
✅ fix: resolve pagination issue in product list
✅ docs: update deployment guide
✅ feat(product): add feature configuration support
✅ refactor(api): simplify product service
✅ perf: optimize database query performance
❌ Add product feature (missing type)
❌ feat: Add Feature (uppercase first letter)
❌ featadd feature (missing colon and space)
❌ feature: add feature (invalid type, should be "feat")
❌ feat:add feature (missing space after colon)
Must include a ## 📝 Description section with at least 10 characters of meaningful content.
Format:
## 📝 Description
[Your changes - minimum 10 characters]You can use:
- Bullet points (recommended)
- Paragraphs
- Mixed format
Examples:
Style 1: Bullet Points (Recommended)
## 📝 Description
- Add feature field to product DTO
- Create ModelFeatureForm component
- Update product service logic
- Add database migration scriptStyle 2: Paragraphs
## 📝 Description
This PR adds product feature configuration functionality for MODEL_API
products. Users can now configure model parameters directly from the
admin panel.Style 3: Detailed
## 📝 Description
### Changes
- Refactored ClientFactory class
- Added ErrorHandler utility
- Updated configuration loading
### Benefits
- Improved code readability
- Better error messages
- 20% faster initializationMust select at least one type of change by checking a checkbox.
Format:
## ✅ Type of Change
- [x] Bug fix (non-breaking change)
- [ ] New feature (non-breaking change)
- [ ] Breaking change
- [ ] Documentation update
- [ ] Code refactoring
- [ ] Performance improvementAvailable Options:
- Bug fix - Fixes an issue without breaking existing functionality
- New feature - Adds new functionality without breaking changes
- Breaking change - Changes that would cause existing functionality to not work as expected
- Documentation update - Changes to documentation only
- Code refactoring - Code changes without functional impact
- Performance improvement - Optimizations that improve performance
- Build/CI configuration change - Changes to build or CI/CD configuration
- Other - Any other type (please describe)
Important: You must check at least one box. This helps reviewers quickly understand the nature of your changes.
Link related issues to help track what's being fixed.
Format:
## 🔗 Related Issues
Fix #123
Close #456Supported Keywords:
Fix #123/Fixes #123/Fixed #123Close #123/Closes #123/Closed #123Resolve #123/Resolves #123/Resolved #123
When the PR is merged, linked issues will be automatically closed.
Describe how you tested your changes to ensure quality and reliability.
Format:
## 🧪 Testing
- [x] Unit tests added/updated
- [x] Integration tests added/updated
- [x] Manual testing completed
- [x] All tests pass locallyTesting Guidelines:
- Describe what testing was performed
- Include test results or verification steps
- Note any edge cases tested
- Confirm all tests pass locally
Example:
## 🧪 Testing
- Added unit tests for new feature configuration logic
- Manually tested with various product types
- Verified backward compatibility with existing products
- All 127 tests pass locallyThe checklist helps ensure code quality and completeness.
Format:
## 📋 Checklist
- [x] Code has been formatted (`mvn spotless:apply` for backend, `npm run lint:fix` for frontend)
- [x] Code is self-reviewed
- [x] Comments added for complex code
- [x] Documentation updated (if applicable)
- [x] No breaking changes (or migration guide provided)
- [x] All CI checks passRecommended Items:
- ✅ Code has been formatted - Run format commands before submitting
- ✅ Code is self-reviewed - Review your own changes first
- Comments added for complex code
- Documentation updated (if applicable)
- No breaking changes (or migration guide provided)
- All CI checks pass
Important: Before submitting your PR:
- Backend: Run
mvn spotless:applyin your project root - Frontend: Run
npm run lint:fixin frontend directory - Review your own code changes
- Commit any formatting changes
If you modified code, indicate whether test coverage was maintained or improved.
Format:
## 📊 Test Coverage
- Added 15 new unit tests
- Overall coverage increased from 65% to 68%
- All critical paths are coveredAny additional context or information reviewers should know.
Format:
## 📚 Additional Notes
- This change requires database migration
- Performance testing shows 20% improvement
- Breaking change: API endpoint path changedEvery PR will automatically trigger three types of checks:
Validates:
- ✅ Type prefix is present and valid
- ✅ Format includes colon and space
- ✅ Description starts with lowercase letter
Result:
- ✅ Pass: Title format is correct
- ❌ Fail: Title format error (with detailed explanation)
Required Items (must pass):
- ✅
## 📝 Descriptionsection exists - ✅ Description content is at least 10 characters
- ✅
## ✅ Type of Changesection exists - ✅ At least one type is checked (e.g.,
- [x] Bug fix)
Optional Checks (recommendations only):
- 💡 Suggests linking issues if not present (
Fix #123) - 💡 Suggests adding testing information
- 💡 Warns if PR is very large (> 500 or > 1000 lines)
Result:
- ✅ Pass: All required sections present with valid content
- ❌ Fail: Missing description, too short, or no type selected
- 💡 Suggestion: Recommendations for improvement
Evaluates:
- 📊 Total lines changed (additions + deletions)
- 📁 Number of files changed
Size Categories:
- 🟢 XS (< 100 lines): Excellent - easy to review
- 🟢 S (100-300 lines): Good - reasonable size
- 🟡 M (300-600 lines): Medium - ensure focused scope
- 🟠 L (600-1000 lines): Large - consider splitting
- 🔴 XL (> 1000 lines): Very large - strongly recommend splitting
Result:
- Always passes (informational only)
- Provides recommendations for large PRs
- Does not block PR submission
Title:
feat: add product feature configuration
Content:
## 📝 Description
- Add feature field to product DTO and database schema
- Create ModelFeatureForm component for configuration UI
- Update product service to persist feature configurations
- Add database migration script for the new column
## 🔗 Related Issues
Fix #123
Close #456
## ✅ Type of Change
- [x] New feature (non-breaking change)
- [ ] Bug fix (non-breaking change)
## 🧪 Testing
- [x] Unit tests added/updated
- [x] Manual testing completed
- Tested with 100+ products, all configurations saved correctly
## 📋 Checklist
- [x] Code has been formatted (`mvn spotless:apply` for backend)
- [x] Code is self-reviewed
- [x] Comments added for complex code
- [x] Documentation updated (if applicable)Check Result:
✅ pr-title-check: Passed
✅ pr-content-check: Passed
✅ pr-size-check: Passed (250 lines - Size: S)
Title:
fix: resolve pagination issue in product list
Content:
## 📝 Description
Fixed SQL injection vulnerability in product list pagination by
replacing string concatenation with parameterized queries.
## 🔗 Related Issues
Fix #789
## ✅ Type of Change
- [x] Bug fix (non-breaking change)
- [ ] New feature (non-breaking change)
## 🧪 Testing
- [x] Unit tests added/updated
- [x] Manual testing completed
- Verified with 10,000+ records - no performance degradation
- Security scan shows vulnerability is resolved
## 📋 Checklist
- [x] Code has been formatted (`mvn spotless:apply` for backend)
- [x] Code is self-reviewed
- [x] All CI checks passCheck Result:
✅ pr-title-check: Passed
✅ pr-content-check: Passed
✅ pr-size-check: Passed (85 lines - Size: XS)
Title:
refactor: simplify client initialization
Content:
## 📝 Description
- Extract initialization logic to separate method
- Remove duplicate code
- Add inline documentation
## 🔗 Related Issues
None
## ✅ Type of Change
- [ ] Bug fix (non-breaking change)
- [ ] New feature (non-breaking change)
- [x] Code refactoring (no functional changes)
## 🧪 Testing
- [x] All tests pass locally
- No new tests needed - refactoring only
- Verified existing functionality unchanged
## 📋 Checklist
- [x] Code has been formatted (`mvn spotless:apply` for backend)
- [x] Code is self-reviewed
- [x] No breaking changesCheck Result:
✅ pr-title-check: Passed
✅ pr-content-check: Passed
✅ pr-size-check: Passed (120 lines - Size: S)
💡 Suggestion: Consider linking related issues
Wrong:
Add new feature
Correct:
feat: add new feature
Error Message:
❌ PR title format is incorrect!
Missing type prefix. Expected format: type: description
Wrong:
feat: Add New Feature
Correct:
feat: add new feature
Error Message:
❌ PR title format is incorrect!
Subject must start with lowercase letter
Wrong:
This PR adds new feature.
## Related Issues
Fix #123Correct:
## Description
This PR adds new feature.
## Related Issues
Fix #123Error Message:
❌ Missing description or too short (at least 10 characters required)
Wrong:
## 📝 Description
Fix bug(Only 7 characters)
Correct:
## 📝 Description
Fix pagination bug in product listError Message:
❌ Missing description or too short (at least 10 characters required)
Wrong:
## 📝 Description
Add new feature
## ✅ Type of Change
- [ ] Bug fix (non-breaking change)
- [ ] New feature (non-breaking change)
- [ ] Breaking changeCorrect:
## 📝 Description
Add new feature
## ✅ Type of Change
- [ ] Bug fix (non-breaking change)
- [x] New feature (non-breaking change)
- [ ] Breaking changeError Message:
❌ 未选择变更类型
Please select at least one Type of Change checkbox
Note: You must check at least one box to indicate what kind of change your PR introduces.
Wrong:
## 📝 Description
Add new feature
## 📋 Checklist
- [ ] Code has been formatted with `mvn spotless:apply` <!-- Not checked -->
- [x] Code is self-reviewedCorrect:
## 📝 Description
Add new feature
## 📋 Checklist
- [x] Code has been formatted (`mvn spotless:apply` for backend) <!-- Must check -->
- [x] Code is self-reviewedNote: Before submitting:
- Backend: Run
mvn spotless:applyin your terminal - Frontend: Run
npm run lint:fixin frontend directory - Commit any formatting changes
- Verify the checklist items apply to your changes
A: Required sections:
- ✅
## 📝 Description(at least 10 characters) - ✅
## ✅ Type of Change(check at least one box)
Optional but recommended:
- 💡
## 🔗 Related Issues(link to related issues) - 💡
## 🧪 Testing(describe testing performed) - 💡
## 📋 Checklist(self-review items) - 💡
## 📊 Test Coverage(coverage information) - 💡
## 📚 Additional Notes(extra context)
A: Yes, but we recommend using English for better collaboration. The title must follow the English format.
A: That's fine! You can write "None" in the Related Issues section or leave it empty. It won't cause the check to fail.
A: Absolutely! Any format is fine as long as it's clear and at least 10 characters. Bullet points are just recommended for readability.
A:
- You'll see a ❌ mark on your PR
- The bot will comment with specific errors
- Edit your PR title or description to fix the issues
- The check will automatically re-run
A: No, but project maintainers can override if there's a valid reason. Generally, following the guidelines is quick and easy.
A: This is a widely adopted convention (Conventional Commits). It keeps commit history clean and consistent.
A: Consider splitting into separate PRs. If they must be together, describe all changes clearly in the Description section.