{"id":27207442,"url":"https://github.com/spencerdcarlson/husky-elixir","last_synced_at":"2025-08-13T15:44:25.025Z","repository":{"id":56425527,"uuid":"153982842","full_name":"spencerdcarlson/husky-elixir","owner":"spencerdcarlson","description":"🐶 Git hooks made easy","archived":false,"fork":false,"pushed_at":"2020-11-08T21:38:24.000Z","size":11465,"stargazers_count":62,"open_issues_count":6,"forks_count":9,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-04-09T23:57:17.425Z","etag":null,"topics":["elixir","git","git-hooks","hooks","husky","workflow"],"latest_commit_sha":null,"homepage":null,"language":"Elixir","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/spencerdcarlson.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2018-10-21T07:13:49.000Z","updated_at":"2025-03-31T20:42:44.000Z","dependencies_parsed_at":"2022-08-15T18:30:52.159Z","dependency_job_id":null,"html_url":"https://github.com/spencerdcarlson/husky-elixir","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/spencerdcarlson%2Fhusky-elixir","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/spencerdcarlson%2Fhusky-elixir/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/spencerdcarlson%2Fhusky-elixir/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/spencerdcarlson%2Fhusky-elixir/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/spencerdcarlson","download_url":"https://codeload.github.com/spencerdcarlson/husky-elixir/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248131396,"owners_count":21052819,"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":["elixir","git","git-hooks","hooks","husky","workflow"],"created_at":"2025-04-09T23:57:21.875Z","updated_at":"2025-04-09T23:57:22.528Z","avatar_url":"https://github.com/spencerdcarlson.png","language":"Elixir","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Husky\n[![Mac/Linux Build Status](https://img.shields.io/travis/spencerdcarlson/husky-elixir.svg?label=Mac%20OSX%20%26%20Linux)](https://travis-ci.org/spencerdcarlson/husky-elixir/branches) [![Hex.pm](https://img.shields.io/hexpm/v/husky.svg)](https://hex.pm/packages/husky) [![Hex.pm](https://img.shields.io/hexpm/dt/husky.svg?style=flat)](https://hex.pm/packages/husky)\n\u003e Git hooks made easy\n\n## Description\nHusky is an elixir version of the [husky](https://www.npmjs.com/package/husky) npm module.\n\nHusky can prevent bad `git commit`, `git push` and more 🐶 ❤️ _woof!_\n\n\n\n## Installation\nThe [Husky](https://hex.pm/packages/husky) Hex package can be installed\nby adding `husky` to your list of dependencies in `mix.exs`:\n```elixir\ndefp deps do\n  [\n    {:husky, \"~\u003e 1.0\", only: :dev, runtime: false}\n  ]\nend\n```\n\n## Usage\n* On compile, husky will install git hook scripts (`mix husky.install` to install manually)\n* Configure git hook commands in either your `config/dev.exs` or a `.husky.json` file\n    * *Note: `config/dev.exs` will take precedence over `.husky.json` if there are key conflicts*\n\n##### Configure Git Hooks Using `config/config.exs`:\n```elixir\nuse Mix.Config\nconfig :husky,\n    pre_commit: \"mix format \u0026\u0026 mix credo --strict\",\n    pre_push: \"mix format --check-formatted \u0026\u0026 mix credo --strict \u0026\u0026 mix test\"\n```\nView example file [config.example.exs](./priv/config.example.exs)\n\n\u003cdetails\u003e\u003csummary\u003e.husky.json\u003c/summary\u003e\n\u003cp\u003e\n\n##### Configure Git Hooks Using `.husky.json`:\n```JSON\n{\n  \"husky\": {\n    \"hooks\": {\n      \"pre_commit\": \"mix format \u0026\u0026 mix credo --strict\",\n      \"pre_push\": \"mix format --check-formatted \u0026\u0026 mix credo --strict \u0026\u0026 mix test\"\n    }\n  }\n}\n```\nView example file [.husky.example.json](./priv/.husky.example.json)\n\u003c/p\u003e\n\u003c/details\u003e\n\nWith the above setup:\n* `git commit` will execute `mix format` and `mix credo --strict` and only commit if credo succeeds.\n* `git push` will execute `mix format`, `mix credo`, and `mix test`, and only push if all three commands succeed.\n* `git commit --no-verify` still commit even if `mix credo --strict` fails\n\n##### Skip script install\n```bash\nexport HUSKY_SKIP_INSTALL=true\n```\n\n##### Temporarily skip hooks\n```bash\nHUSKY_SKIP_HOOKS=true git rebase -i develop\n```\n\n##### Delete\n* Remove git hook scripts `mix husky.delete`\n\n\n\nDocumentation can found at [https://hexdocs.pm/husky](https://hexdocs.pm/husky).\n\n## Contributing\nSee the development [README.md](./dev/README.md)\n\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fspencerdcarlson%2Fhusky-elixir","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fspencerdcarlson%2Fhusky-elixir","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fspencerdcarlson%2Fhusky-elixir/lists"}