Skip to content

Check if the Elixir Library Guidelines are followed #4

@ejpcmac

Description

@ejpcmac

Check for each anti-pattern in the Elixir Library Guidelines.

Anti-patterns

Exceptions used for control flow

Currently, the setup!/0, clear!/0 and drop!/0 in the MnesiaStore.Helpers module only permit to use exceptions. They are used only in the Mix tasks, but could be also used by a user. This should be enhanced in a next version. Maybe these functions should be undocumented or the control flow changed in the Mix tasks.

Application Configuration

Expected is currently configured via application environment, be it for its plugs behaviour or the login store. This environment is then compiled to a module on application start. The plugs can also be configured locally.

The main question regarding this kind of configuration is: what should we do if some user wants two webservers with different Expected configurations? An idea could be to replace the application by a supervisor accepting the configuration as an argument to its init function. But yet: how would we pass the configuration to the plugs? Another way would be to put the configuration under the endpoint module, like Drab 0.9 does (config :expected, MyApp.Endpoint, ...).

Note : reading José Valim on IRC, I understand that the config.exs should contain all and only the global configuration, be it compile-time or runtime.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions