Skip to content

Latest commit

 

History

History
67 lines (53 loc) · 2.29 KB

File metadata and controls

67 lines (53 loc) · 2.29 KB

Contributing to E-Commerce Product Classifier

Thank you for your interest in contributing! This document outlines the process and conventions for contributing to this project.

🔀 Git Workflow

  1. Fork the repository.
  2. Create a feature branch from main:
    git checkout -b feature/your-feature-name
  3. Make your changes following the code style guidelines below.
  4. Write tests for any new functionality.
  5. Run the test suite locally before opening a PR:
    PYTHONPATH=. pytest tests/ -v
  6. Open a Pull Request with a concise description of your changes.

🧑‍💻 Code Style

Python (Backend)

  • Type hints on all function signatures.
  • Docstrings in Google style on all public functions and classes.
  • Logging via logging.getLogger(__name__) — never use print() in library code.
  • Pathlib for all file system operations — avoid os.path.
  • Pydantic for all API request/response schemas.
  • Error handling with try/except that logs the error and re-raises or returns a meaningful message.
  • Max line length: 120 characters.
  • Formatter: Black (recommended).

JavaScript / React (Frontend)

  • Functional components with hooks — no class components.
  • Named exports for components.
  • Tailwind CSS for all styling — no inline style attributes unless dynamic.
  • Axios via the shared apiService for all HTTP calls.
  • Keep components focused: one concern per file.

🧪 Testing Requirements

  • All new backend features must include unit tests in tests/.
  • Use pytest with fixtures for shared setup.
  • Use pytest.approx() for floating-point assertions.
  • Tests must not depend on the model being loaded (use mocks or pytest.mark.skipif).

📝 Commit Messages

Follow Conventional Commits:

feat: add drift detection alerts
fix: correct PSI calculation edge case
docs: update API documentation
test: add monitoring tracker tests
chore: update dependencies

🐛 Reporting Issues

When reporting a bug, please include:

  • Python version and OS.
  • Steps to reproduce.
  • Expected vs actual behavior.
  • Relevant error logs.

📜 License

By contributing, you agree that your contributions will be licensed under the project's MIT License.