Contributing
Thank you for your interest in contributing to MIESC!
Getting Started
Fork the repository on GitHub
Clone your fork locally
Set up development environment:
git clone https://github.com/YOUR_USERNAME/MIESC.git
cd MIESC
pip install -e ".[dev]"
Development Workflow
Create a feature branch:
git checkout -b feat/my-feature
Make your changes
Run tests:
pytest tests/ -v
ruff check src/
mypy src/
Commit with conventional commits:
git commit -m "feat(adapters): add new detector adapter"
Push and create a pull request
Commit Convention
We use Conventional Commits:
feat(scope):New featurefix(scope):Bug fixdocs(scope):Documentationrefactor(scope):Code refactoringtest(scope):Test changeschore(scope):Maintenance
Code Style
Use
blackfor formatting (line length: 100)Use
rufffor lintingAdd type hints to all functions
Write docstrings (Google style)
Example:
def analyze_contract(
path: str,
timeout: int = 300,
) -> AnalysisResult:
"""
Analyze a smart contract for vulnerabilities.
Args:
path: Path to the Solidity file
timeout: Analysis timeout in seconds
Returns:
AnalysisResult with findings and metadata
Raises:
FileNotFoundError: If contract file doesn't exist
"""
...
Adding a New Adapter
Create adapter file in
src/adapters/Implement
ToolAdapterprotocolAdd to adapter registry
Write tests in
tests/Document in
docs/api/adapters.rst
See existing adapters for examples.
Testing
Run the test suite:
# All tests
pytest tests/ -v
# With coverage
pytest tests/ --cov=src --cov-report=html
# Specific test file
pytest tests/test_slither_adapter.py -v
Documentation
Build documentation locally:
cd docs
make html
open _build/html/index.html
Questions?
Open an issue on GitHub
Check existing issues for similar questions