litellm icon indicating copy to clipboard operation
litellm copied to clipboard

Guide check for contribution

Open edwinjosegeorge opened this issue 10 months ago • 3 comments

Enable the checks for code quality locally.

  1. Add pre-commit to run git hooks for flake8, black and mypy.
  2. Fix: async pytest requires pytest-asyncio library to handle coroutines.

edwinjosegeorge avatar Apr 09 '24 03:04 edwinjosegeorge

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
litellm ✅ Ready (Inspect) Visit Preview 💬 Add feedback Apr 12, 2024 3:07am

vercel[bot] avatar Apr 09 '24 03:04 vercel[bot]

hey @edwinjosegeorge we already have this with pre-commit hooks

I don't think you need to run

poetry run flake8
poetry run pytest .

pre-commit should take care of this - https://github.com/BerriAI/litellm/blob/9b7db7ea47156b74a42fac9c0af2cc634943ac8b/.pre-commit-config.yaml#L4

krrishdholakia avatar Apr 09 '24 04:04 krrishdholakia

Hi @krrishdholakia

Thanks for the quick response ❤️ . Upon cloning the repository, I found that there was no mention of pre-commit as a guide but I found the config file. The config file does runs black, flake8 and mypy, but does not run 'pytest'. Installing and configuring pre-commit will surely run these, but not the test files. Maybe we can tag black, flake8 on commit hook and mypy, 'pytest' on push hook.

I also found couple of libraries that is imported, but not used. Running linters pylint can catch a lot of inconsistency improving the code quality.

edwinjosegeorge avatar Apr 09 '24 05:04 edwinjosegeorge

closing as outdated

edwinjosegeorge avatar Jun 13 '24 00:06 edwinjosegeorge