Thank you for your interest in contributing to wazuh-dfn! This document provides guidelines and instructions for contributing to the project.
- Create a virtual environment:
python3.12 -m virtualenv venv
source venv/bin/activate
- Install development dependencies:
pip install -e ".[dev]"
- Follow PEP 8 guidelines
- Use type hints for all function parameters and return values
- Write docstrings for all public functions and classes
- Keep lines under 100 characters
- Use black for code formatting
- Use isort for import sorting
- Run the test suite:
pytest
- Ensure test coverage:
pytest --cov=wazuh_dfn
- Fork the repository
- Create a feature branch (
git checkout -b feature/amazing-feature
) - Make your changes
- Run the test suite
- Update documentation if needed
- Commit your changes (
git commit -m 'Add amazing feature'
) - Push to your fork (
git push origin feature/amazing-feature
) - Open a Pull Request
- Use the present tense ("Add feature" not "Added feature")
- Use the imperative mood ("Move cursor to..." not "Moves cursor to...")
- Limit the first line to 72 characters
- Reference issues and pull requests in the body
- Pick an issue to work on or create a new one
- Discuss the proposed changes in the issue
- Fork and clone the repository
- Create a new branch for your changes
- Make your changes
- Write or update tests
- Update documentation
- Submit a pull request
- At least one maintainer must review and approve the changes
- All automated checks must pass
- Documentation must be updated if needed
- Test coverage should not decrease
- Update version in pyproject.toml
- Update CHANGELOG.md
- Create a new release tag
- Build and publish to PyPI
- Python 3.12
- virtualenv
- git
- Clone your fork:
git clone https://github.com/your-username/wazuh-dfn.git
cd wazuh-dfn
- Set up development environment:
python3.12 -m virtualenv venv
source venv/bin/activate
pip install -e ".[dev]"
- Install pre-commit hooks:
pre-commit install
- Run all tests:
pytest
- Run specific test:
pytest tests/test_specific.py
- Run with coverage:
pytest --cov=wazuh_dfn --cov-report=html
- Update README.md for user-facing changes
- Update docstrings for API changes
- Add comments for complex logic
- Update configuration examples if needed
- Open an issue for bugs
- Use discussions for questions
- Tag maintainers for urgent issues
By contributing, you agree that your contributions will be licensed under the same license as the project (see LICENSE file).