English | 中文
Before submitting a patch, ensure:
- Code compiles cleanly for at least one platform
- Code passes
scripts/check-patch.sh - Every commit has a
Signed-off-bytag - Commit message follows the format described below
subsystem: short summary of change
Optional longer description explaining the motivation
and approach. Wrap at 76 characters.
Signed-off-by: Your Name <your@email.com>
- Subject line:
subsystem: description(lowercase subsystem, no trailing dot) - Subject length: 76 characters max
- Body: separated from subject by a blank line, wrapped at 76 characters
- Signed-off-by: required on every commit (
git commit -s)
| Prefix | Scope |
|---|---|
osal |
OS abstraction layer (osal/) |
gateway |
Message routing (src/core/gateway.*) |
swarm |
Swarm service (src/services/swarm/) |
net |
Network service (src/services/net/) |
ai |
AI engine (src/services/ai/) |
platform |
Platform-specific changes (platform/) |
build |
Build system (SCons, CMake, scripts) |
docs |
Documentation changes |
tools |
Tool scripts (tools/, scripts/) |
gateway: add priority-based message routing
Messages now carry a priority field. The gateway dispatches
high-priority messages before low-priority ones in each
routing cycle.
Signed-off-by: Chao Liu <chao.liu.zevorn@gmail.com>
osal: implement mutex timeout for RT-Thread
Signed-off-by: Chao Liu <chao.liu.zevorn@gmail.com>
Fixes: <sha> ("original commit subject")— when fixing a previous commitTested-by:/Reviewed-by:— attribution for testing and review
See Coding Style for the full coding style guide.
Key points:
- 4 spaces, no tabs
- 80-char line width target
claw_prefix for public API- Traditional C comments (
/* */) - C99 (gnu99)
# Check all source in scope (src/ + osal/)
scripts/check-patch.sh
# Check staged changes (useful before committing)
scripts/check-patch.sh --staged
# Check specific files
scripts/check-patch.sh --file src/core/gateway.c# Check commits since main
scripts/check-dco.sh
# Check last 3 commits
scripts/check-dco.sh --last 3Install git hooks to automatically check style and commit messages:
scripts/install-hooks.sh # install
scripts/install-hooks.sh --remove # removeHooks installed:
- pre-commit: runs
check-patch.sh --stagedon code insrc/andosal/ - commit-msg: validates commit message format and Signed-off-by
Each commit should be a self-contained, compilable change. Don't combine unrelated changes in one commit.
Don't mix style fixes with functional changes. If code needs reformatting, submit it as a separate commit.
- Build for at least one platform before submitting
- If adding a feature, include a basic test or demo if applicable
By adding a Signed-off-by tag to your commit, you certify that:
- The contribution was created in whole or in part by you and you have the right to submit it under the MIT license; or
- The contribution is based upon previous work that, to the best of your knowledge, is covered under an appropriate open source license and you have the right to submit that work with modifications; or
- The contribution was provided directly to you by some other person who certified (1) or (2) and you have not modified it.