Skip to content

Conversation

@AdrienVannson
Copy link
Contributor

Summary

Use Ruff instead of black+isort. This has the following avantages:

  • Ruff is much faster than black+isort. In my project, it reduced the compilation time of the proto files by half. It will also make the use in the project more convenient.
  • It will allow to greatly simplify how import are added to the output file. Instead of having a lot of code to check which imports need to be added to the generated file, it is possible to add all of them and tell Ruff to remove the useless ones. It will make everything easier and less subject to bugs
  • In some cases, the formatting may be better

This was requested in danielgtaylor/python-betterproto#488 , and I agree it is a good choice.

For now, Ruff is only used as a formatter and not as a linter

Checklist

  • If code changes were made then they have been tested.
  • This PR fixes an issue.

@AdrienVannson AdrienVannson merged commit 226752a into main Dec 4, 2024
18 checks passed
@github-advanced-security
Copy link

This pull request sets up GitHub code scanning for this repository. Once the scans have completed and the checks have passed, the analysis results for this pull request branch will appear on this overview. Once you merge this pull request, the 'Security' tab will show more code scanning analysis results (for example, for the default branch). Depending on your configuration and choice of analysis tool, future pull requests will be annotated with code scanning analysis results. For more information about GitHub code scanning, check out the documentation.

@AdrienVannson AdrienVannson deleted the use-ruff branch December 4, 2024 17:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants