Recode.Config (Recode v0.8.0)
View SourceFunctions to read and merge the Recode configuration.
Summary
Functions
Returns the default configuration.
Returns the default config filename.
Deletes the given tasks from the config.
Merges two configs into one.
Reads the Recode cofiguration from the given path.
Returns the given config as a formatted string with comments.
Validates the config version and tasks.
Types
@type config() :: keyword()
Functions
@spec default() :: config()
Returns the default configuration.
Returns the default config filename.
Deletes the given tasks from the config.
Merges two configs into one.
The merge will do a deep merge. The merge takes the version from the right
config.
Examples
iex> new = [version: "0.0.2", verbose: false, autocorrect: true]
...> old = [version: "0.0.1", verbose: true]
iex> Recode.Config.merge(new ,old) |> Enum.sort()
[autocorrect: true, verbose: true, version: "0.0.2"]
Reads the Recode cofiguration from the given path.
Returns the given config as a formatted string with comments.
@spec validate(config()) :: :ok | {:error, :out_of_date | :no_tasks}
Validates the config version and tasks.