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(githooks): add pre-commit scripts for adorno #34

Merged
merged 1 commit into from
Sep 18, 2024
Merged

Conversation

3esmit
Copy link

@3esmit 3esmit commented Sep 12, 2024

Description

I always have this problem on forgetting to send lint to the PR, than the CI will run and fail, and I will have to do --force commits.
This would automate the process by automatically running commands we have to use before commiting.
This githook can be enabled by adding a file on .git/hooks folder calling these scripts.

Checklist

Ensure you completed all of the steps below before submitting your pull request:

  • Added natspec comments?
  • Ran pnpm adorno?
  • Ran pnpm verify?

@3esmit 3esmit changed the title chore(githooks): add pre-commit scripts for adorno and solc vscode sync chore(githooks): add pre-commit scripts for adorno Sep 13, 2024
@@ -0,0 +1,21 @@
#!/bin/bash

foundryup
Copy link
Collaborator

Choose a reason for hiding this comment

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

I don't think I want tihs hook to automatically update the tooling on my machine.

@gravityblast wdyt?

Copy link
Member

Choose a reason for hiding this comment

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

I think the same @0x-r4bbit . I don't really like precommits forced in the repo.
I prefer them to be forced on CI but optional in local

@3esmit
Copy link
Author

3esmit commented Sep 13, 2024

Can we do it ran just once a day? Or in some other action. Somehow we need this because our CI always have latest foundry and updates happen frequently, more than once a day

@0x-r4bbit
Copy link
Collaborator

I think we need to make a decision here:

  1. Either we nail down the foundry version we use collectively and specify it in our CI as well. This means we have to collectively update on the repo if we ever want a newer version
  2. keep using latest nightly of foundry on CI and live with the fact that you could run into errors because your local version is a different one

I guess I prefer option 1.

Wdyt @3esmit @gravityblast ?

@0x-r4bbit
Copy link
Collaborator

If we can't reach consensus here we can also just go with option 2) which means leaving things as is.
We can still merge this PR as the git-hooks directory isn't actually automatically considered as a "hook" folder by git.

So by adding this here, it's not gonna be automatically executed on our machines. Hooks have to live in .git/hooks for that, which is not under version control by design.

I'm fine either way.

Copy link
Collaborator

@0x-r4bbit 0x-r4bbit left a comment

Choose a reason for hiding this comment

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

I'm going to approve this now...

@0x-r4bbit
Copy link
Collaborator

@3esmit You need to sign your commits, then this can be merged.

@3esmit
Copy link
Author

3esmit commented Sep 18, 2024

@3esmit You need to sign your commits, then this can be merged.

Done.

@0x-r4bbit 0x-r4bbit merged commit b2f8411 into main Sep 18, 2024
5 checks passed
@0x-r4bbit
Copy link
Collaborator

Awesome!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Development

Successfully merging this pull request may close these issues.

3 participants