FitMop/CONTRIBUTING.md

1.1 KiB

Contributing to FitMop

Welcome to FitMop! To maintain a high standard of code quality and maintainability, please follow these best practices.

Development Standards

1. Code Style & Linting

We use automated tools to enforce a consistent style.

  • Backend: We use ruff for linting and formatting. Run it with uv run ruff check . --fix.
  • Frontend: We use ESLint and Prettier. Run it with npm run lint and npm run format.

2. Error Handling

  • Never use bare except: clauses. Always specify the exception type.
  • Backend API errors should follow the structured JSON format provided by the global exception handler in main.py.

3. Logging

  • Avoid print() statements in production code.
  • Use the standard logging library in the backend.

4. Type Safety

  • Use Pydantic models for API request and response validation.
  • Preferred frontend language is JavaScript with JSDoc or TypeScript (future goal).

5. Running the Project

Always start the project using the orchestrator script:

bash fitmop.sh

Testing

  • Backend: Use pytest. Run uv run pytest.
  • Frontend: Foundation for vitest is coming soon.