Skip to content

Commit 6030442

Browse files
committed
Add configuration documentation
1 parent b5f9076 commit 6030442

File tree

1 file changed

+24
-0
lines changed

1 file changed

+24
-0
lines changed

README.md

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@ Main features:
3333
* [Auto install](#auto-install)
3434
* [Hook configuration](#hook-configuration)
3535
* [Git submodules](#git-submodules)
36+
* [Custom project path](#custom-project-path)
3637
* [Custom mix path](#custom-mix-path)
3738
* [Troubleshooting in docker containers](#troubleshooting-in-docker-containers)
3839
* [Example config](#example-config)
@@ -119,6 +120,29 @@ Setting a custom _git hooks_ config path is also supported:
119120
git config core.hooksPath .myCustomGithooks/
120121
```
121122

123+
### Custom project path
124+
125+
This library assumes a simple Elixir project architecture. This is, an Elixir
126+
project in the root of a git repository.
127+
128+
If you have a different project architecture, you can specify the absolute path
129+
of your project using the `project_path` configuration:
130+
131+
```elixir
132+
{project_path, 0} = System.cmd("pwd", [])
133+
project_path = String.replace(project_path, ~r/\n/, "/")
134+
135+
config :git_hooks,
136+
hooks: [
137+
pre_commit: [
138+
tasks: [
139+
{:cmd, "mix format --check-formatted"}
140+
]
141+
]
142+
],
143+
project_path: project_path
144+
```
145+
122146
### Custom mix path
123147

124148
This library expects `elixir` to be installed in your system and the `mix` binary to be available. If you want to provide a specific path to run the `mix` executable, it can be done using the `mix_path` configuration.

0 commit comments

Comments
 (0)