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 configuration #86

Merged
merged 1 commit into from
Feb 16, 2024

Conversation

flferretti
Copy link
Collaborator

@flferretti flferretti commented Feb 15, 2024

This PR adds a pre-commit configuration file that includes hooks for checking AST, merge conflicts, YAML syntax, end-of-file, trailing whitespace, and code formatting using Black and isort.


📚 Documentation preview 📚: https://jaxsim--86.org.readthedocs.build//86/

@flferretti flferretti self-assigned this Feb 15, 2024
@diegoferigo
Copy link
Member

Mmh I never liked too much the idea behind committed pre-commits, but in the same time I never investigated in much depth the approach. I want to know more what's your experience with them.

What I dislike is that often I create WIP commits locally (and also push them remotely), and in most cases they are not compliant with the pre-commits rules. I don't want those commits to get blocked or require any additional effort on my side. We do have CI tests before merging PRs for this.

Since these rules get hooked into your personal git configuration, is it an option to just keep them local?

@traversaro
Copy link
Contributor

This PR adds a pre-commit configuration file that includes hooks for checking AST, merge conflicts, YAML syntax, end-of-file, trailing whitespace, and code formatting using Black and isort.

📚 Documentation preview 📚: https://jaxsim--86.org.readthedocs.build//86/

@flferretti can you add a line or two either in the README or somewhere where you see fit explaining either how to use this pre-commit files, or a link to related documentation? I guess most members of AMI (that could contribute to the library) are not aware of how this work.

@flferretti
Copy link
Collaborator Author

flferretti commented Feb 16, 2024

@flferretti can you add a line or two either in the README or somewhere where you see fit explaining either how to use this pre-commit files, or a link to related documentation? I guess most members of AMI (that could contribute to the library) are not aware of how this work.

Sure @traversaro! What about adding a CONTRIBUTING file?

@traversaro
Copy link
Contributor

@flferretti can you add a line or two either in the README or somewhere where you see fit explaining either how to use this pre-commit files, or a link to related documentation? I guess most members of AMI (that could contribute to the library) are not aware of how this work.

Sure @traversaro! What about adding a CONTRIBUTING file?

Sure, as you prefer.

@flferretti
Copy link
Collaborator Author

@traversaro I opened #87 to add a CONTRIBUTING file to the repo. I put the instructions for using the pre-commit in a separate commit, so we can eventually drop it if this doesn't get merged.

@diegoferigo
Copy link
Member

I found interesting information for beginners in the following blog post:

https://www.elliotjordan.com/posts/pre-commit-01-intro/

@flferretti flferretti merged commit c749a3a into ami-iit:main Feb 16, 2024
12 checks passed
@flferretti flferretti deleted the feature/pre-commit branch March 15, 2024 09:48
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.

None yet

3 participants