{"id":19806009,"url":"https://github.com/cycloidio/cycloid-hooks","last_synced_at":"2026-06-04T20:31:15.182Z","repository":{"id":83786364,"uuid":"59738322","full_name":"cycloidio/cycloid-hooks","owner":"cycloidio","description":"Gathering of hooks used at cycloid","archived":false,"fork":false,"pushed_at":"2019-01-14T13:57:18.000Z","size":27,"stargazers_count":2,"open_issues_count":6,"forks_count":0,"subscribers_count":8,"default_branch":"master","last_synced_at":"2025-01-11T06:13:21.878Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Shell","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/cycloidio.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2016-05-26T09:36:37.000Z","updated_at":"2019-01-14T13:57:20.000Z","dependencies_parsed_at":null,"dependency_job_id":"35f87fbb-8a1c-451b-b6c7-38f19a34da0c","html_url":"https://github.com/cycloidio/cycloid-hooks","commit_stats":{"total_commits":35,"total_committers":5,"mean_commits":7.0,"dds":0.3142857142857143,"last_synced_commit":"d421bcf73c5cc0386885f7387633b084f0f092bf"},"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cycloidio%2Fcycloid-hooks","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cycloidio%2Fcycloid-hooks/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cycloidio%2Fcycloid-hooks/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cycloidio%2Fcycloid-hooks/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/cycloidio","download_url":"https://codeload.github.com/cycloidio/cycloid-hooks/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":241150243,"owners_count":19918334,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-12T09:06:09.401Z","updated_at":"2025-02-28T12:19:44.649Z","avatar_url":"https://github.com/cycloidio.png","language":"Shell","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Cycloid-hooks\nGathering of hooks used at cycloid\n\n# Content\n[update_hook.sh](https://github.com/cycloidio/cycloid-hooks/blob/master/scripts/update_hook.sh): Used to make it easier to update hooks of git directories.\n\n[commit-msg](https://github.com/cycloidio/cycloid-hooks/blob/master/client-side/commit-msg): Hook to encourage the formatting of git commit, following the style of [the linux repo](https://github.com/torvalds/linux/commits/master).\n\n[pre-commit](https://github.com/cycloidio/cycloid-hooks/blob/master/client-side/pre-commit): A wrapper that is meant to call all pre-commit hooks located in pre-commit.d folder\n\n[pre-commit-ansible-vault](https://github.com/cycloidio/cycloid-hooks/blob/master/client-side/pre-commit.d/pre-commit-ansible-vault): Used to check if any ansible vault file is being pushed without encryption\n\n[pre-commit-gofmt](https://github.com/cycloidio/cycloid-hooks/blob/master/client-side/pre-commit.d/pre-commit-gofmt): Meant to check the formatting of go files before pushing them.\n\n[pre-push](https://github.com/cycloidio/cycloid-hooks/blob/master/client-side/pre-push): Used as safety net to check if any ansible vault file has been localy commited before being pushed. Very similar to [pre-commit-ansible-vault](https://github.com/cycloidio/cycloid-hooks/blob/master/client-side/pre-commit.d/pre-commit-ansible-vault).\n\n# How to use\nIf not already the case, create a template directory for git that you will use:\n```bash\nmkdir -p $HOME/.git_template/hooks/\n```\n\n(Again if not already the case) Update your gitconfig:\n```bash\n[init]\n\ttemplatedir = \u003c/home/.../.git_template\u003e\n```\nNote: This is the full path, not including env variable!\n\nGet the repository with the eventual branch that you want:\n```bash\ngit clone https://github.com/cycloidio/cycloid-hooks/ $HOME/git/cycloid-hooks/\n```\n\nThen, the easiest could be to setup an alias based on the script in order to do the updates.\n\nExample of alias - admitting your git repositorie(s) is(are) located in `$HOME/git/my-git-projects` directory:\n\n```bash\nalias update_hooks='rsync -arq $HOME/git/cycloid-hooks/client-side/ $HOME/.git_template/hooks/ \u0026\u0026 $HOME/git/cycloid-hooks/scripts/update_hook.sh -v -t $HOME/.git_template/hooks -r $HOME/git/my-git-projects'\n\n# Now you can call it with\nupdate_hooks\n```\n\nUsage of the script:\n```bash\nusage: update_hook.sh -r GIT_DIR -t TEMPLATE_HOOK_DIR [-v]\n\nThis script updates all hooks located in the TEMPLATE_HOOK_DIR of all repositories located under the GIT_DIR.\nThis allows to easily update hooks to use their latest version.\n\nOPTIONS:\n   -r       Directory containing all repositories\n   -t       Template directory containing hooks\n   -v       Verbose enablement\n```\n\n# License\nThe MIT License (MIT)\n\nCopyright (c) 2016 cycloid.io\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all\ncopies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\nSOFTWARE.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcycloidio%2Fcycloid-hooks","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcycloidio%2Fcycloid-hooks","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcycloidio%2Fcycloid-hooks/lists"}