Skip to content

Add ruff format check in pre-commit hook and CI #660

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: dev
Choose a base branch
from

Conversation

trdthg
Copy link
Contributor

@trdthg trdthg commented Jun 9, 2025

Description

I believe that we will fully format the code anyway, as it is necessary for the maintainability of the project.

This PR adds a CI to check whether the PR is correctly formatted.
It also adds a pre-commit hook to help users perform format check locally

I created a basic formatted configuration and simply modified the default line-length 和 quote-style

The only thing to note is that the ruff format will break our manual alignment of the dictionary,ruff format also doesn't support many customization options, but this seems to be a common issue with formatting tools, and black (a more mature formatter) has the same problem https:github.com/psf/black/issues/4281

@jamesbeyond jamesbeyond added the size-S Small efforts required label Jul 28, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
size-S Small efforts required
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants