langgenius / dify

Dify is an open-source LLM app development platform. Dify's intuitive interface combines AI workflow, RAG pipeline, agent capabilities, model management, observability features and more, letting you quickly go from prototype to production.
https://dify.ai
Other
35.59k stars 4.8k forks source link

chore(pyproject.toml): Add Ruff formatter config. #5627

Closed laipz8200 closed 3 days ago

laipz8200 commented 3 days ago

Description

This change is in preparation for the future introduction of the Ruff formatter. For now, we will not require the use of any formatter.

Fixes # (issue)

Type of Change

Please delete options that are not relevant.

How Has This Been Tested?

Suggested Checklist:

bowenliang123 commented 3 days ago

Note: And the change in this PR is not effective at the moment, which surely will cause many changes in future.

laipz8200 commented 3 days ago

Note: And the change in this PR is not effective at the moment, which surely will cause many changes in future.

Sure, it's currently for internal use only.

bowenliang123 commented 3 days ago

And be careful when use Ruff's formatter and linter together. Some rules may be conflict.

laipz8200 commented 3 days ago

And be careful when use Ruff's formatter and linter together. Some rules may be conflict.

Thanks for the reminder! We’ll introduce the formatter only when we’re ready, or would you be willing to help us check the rules?

bowenliang123 commented 3 days ago

I would prefer apply E and W rules of Ruff linters first ( https://docs.astral.sh/ruff/rules/#pycodestyle-e-w), if you guys are ready to brace a big change in multiple files for one time. Many of them are auto-fixable and help code formatting.

laipz8200 commented 3 days ago

@bowenliang123 Great idea! We also want to apply some currently ignored rules (like F812 and F841). Maybe we will create a list and process them one by one.

bowenliang123 commented 3 days ago

No problem~ SGTM.