https://github.com/infinitered/config_validator
Mix config validation
https://github.com/infinitered/config_validator
Last synced: 6 months ago
JSON representation
Mix config validation
- Host: GitHub
- URL: https://github.com/infinitered/config_validator
- Owner: infinitered
- License: mit
- Created: 2017-09-29T15:37:40.000Z (over 8 years ago)
- Default Branch: master
- Last Pushed: 2017-09-29T17:25:02.000Z (over 8 years ago)
- Last Synced: 2025-05-29T23:41:43.660Z (8 months ago)
- Language: Elixir
- Size: 13.7 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
Awesome Lists containing this project
README
# ConfigValidator
[](https://semaphoreci.com/ir/config_validator)
[](https://hex.pm/packages/config_validator)
[](http://inch-ci.org/github/infinitered/config_validator)
Configuration validation for Mix config files.
## Why
When you set a Mix configuration value equal to an environment variable,
that variable must be present at compile time or in your deployment
environment for your app to function properly.
It's easy to forget to do this, causing unecessary bugs. ConfigValidator
gives you the tools to prevent that from ever happening again.
## How
ConfigValidator reads your `config/config.exs` file (or other config file of
your choosing), and looks for nil settings.
It is smart enough to understand both of the following ways of referencing
an ENV variable:
System.get_env("VAR_NAME")
{:system, "VAR_NAME"}
If a nil setting is found, `ConfigValidator` can raise an error at compile
time, start up, or just log a warning. It's up to you.
See the [Hex Docs](https://hexdocs.pm/config_validator) for more information.
## Installation
Add `config_validator` to your list of dependencies in `mix.exs`:
```elixir
def deps do
[
{:config_validator, "~> 0.1.2"}
]
end
```