Skip to content

Re-compile when config changes #18

Open

Description

@finnhodgkin

We need to work out how to re-compile the pre_commit task when the config changes.

Example:
A user sets up pre_commit for a project with just test in the config.
The next day, the user adds credo --strict to the config, but the pre_commit doesn't update 😢

Currently the only way to force an update is to delete the build folder and recompile.

Activity

  1. finnhodgkin commented on Oct 15, 2017

    @finnhodgkin
    CollaboratorAuthor

    A temporary fix for this is to include a section in the docs advising people to run mix clean --deps after changing pre_commit configuration.

  2. finnhodgkin commented on Dec 8, 2017

    @finnhodgkin
    CollaboratorAuthor

    I think the envy module reloads module configs so maybe we could take a look there at some point.

    Update with potential fix

     @doc """
      Reloads `config/config.exs`. This function can be used to reload configuration
      that relies on environment variables set by Envy.
      This workaround is necessary since config files don't have
      access to dependencies.
      """
      def reload_config do
        Mix.Config.read!("config/config.exs") |> Mix.Config.persist
      end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions