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

chore(*): add pre-commit hooks for formatting #157

Closed
wants to merge 2 commits into from

Conversation

RaitoBezarius
Copy link
Contributor

This adds pre-commit hooks for formatting, because I usually just trust whatever people prefer locally :).
We could add, e.g. rustfmt, but I prefer @sonmarcho that you tell me what you prefer regarding this. Pre-commit hooks can be pesky and annoying.

Signed-off-by: Ryan Lahfa [email protected]

Ryan Lahfa added 2 commits April 24, 2024 11:27
https://dune.readthedocs.io/en/stable/usage.html#finding-the-root

This is necessary for tools that tries to work without having
`compiler/` as the cwd, e.g. linters.

Signed-off-by: Ryan Lahfa <[email protected]>
This avoids the difficult situation where CI yells at me and I force
push 5 times after :'(.

It works only for Nix shells.

Signed-off-by: Ryan Lahfa <[email protected]>
Copy link
Member

@Nadrieril Nadrieril left a comment

Choose a reason for hiding this comment

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

We recently added CI checks for formatting, this makes a lot of sense. Could you do the same (with rustfmt also) on Charon's side?

@RaitoBezarius
Copy link
Contributor Author

We recently added CI checks for formatting, this makes a lot of sense. Could you do the same (with rustfmt also) on Charon's side?

Yes, of course!

@sonmarcho
Copy link
Member

In practice what does this do? It only uses pre commit hooks if you're using nix, right? If that's the case and you consider it's idiomatic when using nix, I'm fine.

aeneas-verify-hol4
aeneas-check-tidiness;

pre-commit-check = pre-commit-hooks.lib.${system}.run {
Copy link
Member

Choose a reason for hiding this comment

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

I'm not a huge fan of pre-commit hooks because I rebase a lot... I does make sense though, we can try it for a bit

Copy link
Member

Choose a reason for hiding this comment

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

Can you add a comment here to explain what this does (this formats the code at commit time, etc.)?

@Nadrieril
Copy link
Member

Now that my editor formats everything automatically I'm not longer keen on having this

@sonmarcho
Copy link
Member

This PR seems dead, so I'm closing it. Feel free to reopen it if you really want this feature.

@sonmarcho sonmarcho closed this Jun 30, 2024
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.

3 participants