Skip to content

Latest commit

 

History

History
50 lines (37 loc) · 1.3 KB

File metadata and controls

50 lines (37 loc) · 1.3 KB

Contributing

Contributions are welcome! Here's how to get started.

Setup

git clone https://github.com/azizjon-aliev/python-dsa.git
cd python-dsa
uv sync --group dev
uv run pre-commit install

Development workflow

  1. Create a branch from main
  2. Implement your changes
  3. Run checks before committing:
uv run pytest tests/ -v              # tests + coverage
uv run ruff check .                  # linter
uv run ruff format .                 # formatter
uv run ty check                      # type checker
  1. Open a pull request

Adding a new data structure

  1. Create an ABC interface in <module>/base.py
  2. Implement the concrete class in its own file
  3. Add __repr__, __str__, __eq__, __bool__, __len__, __contains__
  4. Add tests in tests/test_<module>.py
  5. Add property-based tests in tests/test_properties.py
  6. Update README.md with usage examples and complexity table

Adding a new algorithm

  1. Create the module under algorithms/<category>/
  2. Add tests in tests/test_<algorithm>.py
  3. Update README.md

Code style

  • Follow existing patterns in the codebase
  • Use type hints everywhere
  • Add docstrings with complexity notes (e.g. O(n))
  • Keep line length under 88 characters (enforced by ruff)
  • All pre-commit hooks must pass before merging