fdfzcq / config_comparator

[Derivco Sweden Hackathon 7] compare configurations in .exs and .sys.config format

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

ConfigComparator

Used to compare erlang sys.config configuration file with the elixir .exs configuration file.

Installation

If available in Hex, the package can be installed as:

  1. Add config_comparator to your list of dependencies in mix.exs:
```elixir
def deps do
  [{:config_comparator, "~> 0.1.0"}]
end
```
  1. Ensure config_comparator is started before your application:
```elixir
def application do
  [applications: [:config_comparator]]
end
```

Commands

Example usage:

ConfigComparator.Comparator.compare({{path_to_sysconfig}}, {{path_to_elixir_config}})

Example output:

Difference found: {{:foo, foo}, :foo}
In exs config: [%{country: "England"}]
But in sys.config: [%{country: "England"}, %{country: "Germany"}]

Difference found: {{:bar, bar}, :bar}
In exs config: 90
But in sys.config: 100
No difference found!

Configuration

# config/config.exs
e.g.
  config :config_comparator, ignored_keys:
                          [{{:a, :b}, :c},
                           {{:foo, :bar}, :hello_world}]

About

[Derivco Sweden Hackathon 7] compare configurations in .exs and .sys.config format

License:Apache License 2.0


Languages

Language:Elixir 100.0%