Closed Undertone0809 closed 5 months ago
@krrishdholakia Hope to receive your feedback 👋
FYI we use isort
+ flake8 linting throughout the litellm code base now
@Undertone0809 I'm closing this issue since we've address the concern of adding linting / code formatting
Feel free to open a new issue for moving to ruff
The Feature
Hi there,
To ensure our project's code quality and consistency, I propose that we consider adopting
ruff
as our primary tool for code formatting and linting. [ruff]() is a cutting-edge tool that amalgamates the capabilities ofblack
,isort
, andflake8
, facilitating the automation of code style standardization to enhance readability and maintainability.ref: enhancing-python-code-quality-a-comprehensive-guide-to-linting-with-ruff
I have explored configuring
ruff
and found that we can seamlessly integrate it by adding some basic settings to ourpyproject.toml
. This approach ensures uniform code styling without the need for manual adjustments across multiple tools. For reference, here's a template: Python Package Template.Within our development workflow, we can format our code using the following command:
This command will format the code within the
hooks
andtests
directories, ensuring consistency before commits.Moreover, I recommend integrating
ruff
into our pre-commit hooks. This automatic check will prevent code style inconsistencies from being merged into our codebase.Finally, to guarantee consistent code styling throughout our project, I suggest employing GitHub Actions to automate code format checking. This ensures that any commits not adhering to our styling standards are flagged for correction before merging into the main branch.
By adopting
ruff
, I believe we can further elevate our code quality and foster a smoother collaborative experience for our team. I look forward to hearing your thoughts and am happy to answer any questions regarding this proposal.There projects use code format tool as references.
Developers can not pass the github actions check if there is no formatting. To ensure consistency in code style.
Motivation, pitchzh
To ensure our project's code quality and consistency.