diff --git a/README.md b/README.md index 9140dc7..b2fcc3e 100644 --- a/README.md +++ b/README.md @@ -164,8 +164,8 @@ when you make a commit. ## Configuration -terraform-docs can be configured with a yaml file. Default name of this file is -`.terraform-docs.yml` and the order for lookig for it is: +terraform-docs can be configured with a yaml file. The default name of this file is +`.terraform-docs.yml` and the path order for locating it is: 1. root of module directory 1. `.config/` folder at root of module directory diff --git a/docs/user-guide/configuration.md b/docs/user-guide/configuration.md index 03086e5..29f7501 100644 --- a/docs/user-guide/configuration.md +++ b/docs/user-guide/configuration.md @@ -11,12 +11,24 @@ weight: 120 toc: true --- -The `terraform-docs` configuration is a yaml file. This is a convenient way to -share the configuation amongst teammates, CI, or other toolings. To do so you -can use `-c` or `--config` flag which accepts name of the config file. +The `terraform-docs` configuration file uses the [yaml format](https://yaml.org/) in order to override any default behaviors. +This is a convenient way to share the configuration amongst teammates, CI, or other toolings. -Default name of this file is `.terraform-docs.yml`, and it will get picked up -(if existed) without needing to explicitly passing with config flag. +terraform-docs will locate any available configuration file without needing to explicitly pass the `--config` flag. + +The default name of the configuration file is `.terraform-docs.yml`. +The path order for locating it is: + +1. root of module directory +1. `.config/` folder at root of module directory (since v0.15.0) +1. current directory +1. `.config/` folder at current directory (since v0.15.0) +1. `$HOME/.tfdocs.d/` + +if `.terraform-docs.yml` is found in any of the folders above, that will take +precedence and will override the other ones. + +Here is an example for how your terraform project file structure might look, and where the `.terraform-docs.yml` file can be placed: ```bash $ tree @@ -29,6 +41,9 @@ $ tree $ terraform-docs . ``` +To use an alternative configuration file name or path you +can use the `-c` or `--config` flag. + Or you can use a config file with any arbitrary name: ```bash @@ -42,17 +57,6 @@ $ tree $ terraform-docs -c .tfdocs-config.yml . ``` -As of `v0.13.0`, the order for looking for config file is: - -1. root of module directory -1. `.config/` folder at root of module directory (since v0.15.0) -1. current directory -1. `.config/` folder at current directory (since v0.15.0) -1. `$HOME/.tfdocs.d/` - -if `.terraform-docs.yml` is found in any of the folders above, that will take -precedence and will override the other ones. - {{< alert type="primary" >}} Values passed directly as CLI flags will override all of the above. {{< /alert >}} diff --git a/docs/user-guide/configuration/sections.md b/docs/user-guide/configuration/sections.md index 0187da9..66d6078 100644 --- a/docs/user-guide/configuration/sections.md +++ b/docs/user-guide/configuration/sections.md @@ -54,7 +54,7 @@ sections: ## Examples -Show only `providrs`, `inputs`, and `outputs`. +Show only `providers`, `inputs`, and `outputs`. ```yaml sections: @@ -64,7 +64,7 @@ sections: - outputs ``` -Show everything except `providrs`. +Show everything except `providers`. ```yaml sections: