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-push hook example #2606

Merged
merged 1 commit into from
Nov 19, 2022

Conversation

akanshak984
Copy link
Contributor

@akanshak984 akanshak984 commented Oct 28, 2022

Summary

  • Added an example of pre-push hook.
  • The example hook executes the command bundle exec rake - which runs both the linter and the tests before push.
  • Updated CONTRIBUTING.md with steps for set-up and how to disable and skip the hook.

Reference comment: #2571 (comment)

Close #2571

@akanshak984 akanshak984 marked this pull request as draft October 28, 2022 21:23
pre-push.sample Outdated Show resolved Hide resolved
@stefannibrasil
Copy link
Contributor

Is this ready for review or is still a draft?

@akanshak984
Copy link
Contributor Author

Is this ready for review or is still a draft?

It is in draft - As, I have only tested it on Linux. Will update after testing in windows and MacOS

@akanshak984
Copy link
Contributor Author

Is this ready for review or is still a draft?

It is in draft - As, I have only tested it on Linux. Will update after testing in windows and MacOS

Tested on Windows and MacOS - It is working fine (Had to add shebang #!/bin/sh)

@akanshak984 akanshak984 marked this pull request as ready for review November 8, 2022 13:00
Copy link
Contributor

@stefannibrasil stefannibrasil left a comment

Choose a reason for hiding this comment

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

HI @akanshak984 thank you for working on this! This is really cool 😎

Could you create a folder called custom-hooks and place the example file there? It keeps the repository organized.

Also, could you edit the PR to say "Closes issue issue_number?" That way, the issues is automatically closed when this PR is merged. Thank you!

CONTRIBUTING.md Outdated Show resolved Hide resolved
CONTRIBUTING.md Outdated Show resolved Hide resolved
- The example hook runs test and linter before push.
- Update Contributing.md exaplining the set-up and usage.
@akanshak984
Copy link
Contributor Author

Could you create a folder called custom-hooks and place the example file there? It keeps the repository organized.

Sure, Done!

edit the PR to say "Closes issue issue_number?"

Done!

@akanshak984 akanshak984 requested review from stefannibrasil and removed request for Zeragamba November 19, 2022 10:44
Copy link
Contributor

@stefannibrasil stefannibrasil left a comment

Choose a reason for hiding this comment

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

This is awesome. Thank you @akanshak984 🎉

@stefannibrasil stefannibrasil merged commit 6462609 into faker-ruby:main Nov 19, 2022
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.

Add git hook(s) to automate linting before or during a push
3 participants