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

Add pre-commit code formatting #10

Merged
merged 1 commit into from Apr 12, 2022
Merged

Add pre-commit code formatting #10

merged 1 commit into from Apr 12, 2022

Conversation

Serneum
Copy link
Collaborator

@Serneum Serneum commented Apr 8, 2022

This change adds a new pre-commit hook that will run cargo fmt and add the changed files to the commit. This ensures that all of the code in the repository meets our code quality standards, and removes the responsibility of running the fmt command from the author so that they are not forced to remember and reviewers do not need to ask for formatting updates. This also conveniently adds the updates to the commit containing the changed files so that the author does not need to do any squashing or fixing up later.

To install the new commit hook in your local workspace, you can run ./scripts/create-git-hooks, which will set up a symlink to a hooks-wrapper script that can run any commit hook that we currently have or add in the future.

Copy link
Contributor

@jhodapp jhodapp left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tested locally, works great just like it does in the ambi repo.

Thanks for this Chris, very nice work!

@Serneum Serneum merged commit e22ac32 into master Apr 12, 2022
@Serneum Serneum deleted the add-pre-commit-format branch April 12, 2022 14:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
No open projects
Status: Done
Development

Successfully merging this pull request may close these issues.

None yet

3 participants