Thank you for your interest in contributing to libModbus! This document provides guidelines and instructions for contributing to this project.
By participating in this project, you are expected to uphold our Code of Conduct:
- Be respectful and inclusive
- Exercise consideration and respect in your speech and actions
- Attempt collaboration before conflict
- Refrain from demeaning, discriminatory, or harassing behavior
Before creating a bug report, please check the existing issues to avoid duplicates.
How to Submit a Good Bug Report:
- Use a clear and descriptive title
- Describe the exact steps to reproduce the problem
- Provide specific examples to demonstrate the steps
- Describe the behavior you observed and what you expected
- Include any relevant logs, screenshots, or code examples
- Specify your environment (OS, compiler, hardware)
We welcome suggestions for new features and improvements!
How to Submit a Good Enhancement Suggestion:
- Use a clear and descriptive title
- Provide a detailed description of the proposed functionality
- Explain why this enhancement would be useful
- Include examples of how the feature would be used
- List any alternative solutions you've considered
-
Fork the Repository
git clone --recurse-submodules https://github.com/OpenModbus/libModbus.git cd libModbus -
Create a Feature Branch
git checkout -b feature/amazing-feature # or git checkout -b fix/issue-description -
Make Your Changes
-
Follow the coding standards below
-
Add tests for new functionality
-
Update documentation as needed
-
-
Run Tests
make
-
Commit Your Changes
git commit -s -m "Add amazing feature" -
Push to Your Fork
git push origin feature/amazing-feature
-
Open a Pull Request
-
Use a clear title and description
-
Reference any related issues
-
Ensure all checks pass
-
-
Follow the existing code style
-
4-space indentation (no tabs)
-
80-character line limit where practical
-
Use descriptive variable and function names
/**
* Brief description of function
*
* @param param1 Description of first parameter
* @param param2 Description of second parameter
* @return Description of return value
*/
static int example_function(int param1, const char *param2) {
if (param1 == 0) return -1;
// Complex operations should have comments
int result = perform_operation(param1, param2);
return result;
}-
Document all public APIs with Doxygen-style comments
-
Update README.md for user-facing changes
-
Comment complex algorithms and business logic
-
Keep comments up-to-date with code changes
-
All new features must include unit tests
-
Bug fixes should include regression tests
-
Maintain 100% test coverage for new code
-
Tests should be independent and repeatable
Commit Message Format:
<type>: <description>
[optional body]
[optional footer]
Types:
-
feat: New feature -
fix: Bug fix -
docs: Documentation changes -
style: Code style changes (formatting, etc.) -
refactor: Code refactoring -
test: Adding or updating tests -
chore: Maintenance tasks
-
Open an issue for technical questions
-
Join our discussions for design questions
-
Contact maintainers for sensitive issues
Thank you for contributing to libModbus! 🚀