git clone https://github.com/errnair/ezdns-toolkit.git
cd ezdns-toolkit
python -m venv venv
source venv/bin/activate
pip install -e ".[dev]"pytest
pytest --cov=ezdns
pytest tests/unit/test_validators.py # specific fileUse black for formatting, isort for imports:
black src/ tests/
isort src/ tests/
flake8 src/ tests/
mypy src/Or use the Makefile:
make format
make lint
make testUse Google-style docstrings for public APIs:
def get_a_records(domain: str) -> List[str]:
"""Query A records for domain."""Only document non-obvious parameters and exceptions.
- Add tests for new features
- Maintain or improve code coverage
- Use mocks for external dependencies (DNS, HTTP, WHOIS)
Example:
@patch('dns.resolver.Resolver.resolve')
def test_get_a_records(self, mock_resolve):
mock_resolve.return_value = [Mock(__str__=Mock(return_value='192.0.2.1'))]
resolver = DNSResolver()
records = resolver.get_a_records('example.com')
assert '192.0.2.1' in records- Fork and create a branch from
main - Make your changes
- Add tests
- Run
make checkto verify everything passes - Submit PR with clear description
Include:
- Steps to reproduce
- Expected vs actual behavior
- Environment (OS, Python version)
- Error messages
By contributing, you agree your contributions will be licensed under GPL-3.0.