Skip to content
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

ci: add pre-commit #56

Merged
merged 3 commits into from
Jan 28, 2024
Merged

ci: add pre-commit #56

merged 3 commits into from
Jan 28, 2024

Conversation

xqm32
Copy link
Member

@xqm32 xqm32 commented Jan 27, 2024

No description provided.

@xqm32 xqm32 requested a review from zyr17 as a code owner January 27, 2024 17:25
@zyr17
Copy link
Member

zyr17 commented Jan 28, 2024

Thanks! The first two commit adds pre-commit hook, and last commit fixed all format problems in current codes, am I right?

What I need to do is, installing pre-commit with pip, then write codes as usual, and when I create a new commit, new codes will be automatically formatted?

@xqm32
Copy link
Member Author

xqm32 commented Jan 28, 2024

Thanks! The first two commit adds pre-commit hook, and last commit fixed all format problems in current codes, am I right?

What I need to do is, installing pre-commit with pip, then write codes as usual, and when I create a new commit, new codes will be automatically formatted?

Yes! These things are almost transparent to you, except for the first installation of pre-commit. You can also use pre-commit run -a to manually run the pre-commit hook (just like run a makefile task).

New commit will be automatically formatted before commit, but the local pre-commit hook will only detect the changed files and the pre-commit Actions will run hook on all files, so we may also need to run pre-commit run -a manually. My third commit is to do so.

@zyr17 zyr17 merged commit d6de385 into master Jan 28, 2024
7 checks passed
@xqm32 xqm32 deleted the add-pre-commit branch January 28, 2024 08:35
@xqm32 xqm32 linked an issue Jan 28, 2024 that may be closed by this pull request
@xqm32 xqm32 mentioned this pull request Jan 28, 2024
@xqm32
Copy link
Member Author

xqm32 commented Jan 28, 2024

Fixes: #54

@xqm32 xqm32 linked an issue Jan 28, 2024 that may be closed by this pull request
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.

Use ruff as formatter and linter Add CI actions for typos
2 participants