elvis_core icon indicating copy to clipboard operation
elvis_core copied to clipboard

New Rule: Unsafe usage of application

Open paulo-ferraz-oliveira opened this issue 1 year ago • 1 comments

Name

unsafe_application_get

Brief Description

In the context of an application, while it's technically possible to do application:get_env(_) for another application, it's usually a bad idea.

Reasoning

Very easy to break if you don't read between the lines, and also indicating that the other application is potentially missing an API function for the same thing.

Refactoring Proposal

  1. not do it
  2. pull request the other application to expose proper config. access functions

paulo-ferraz-oliveira avatar Oct 10 '23 21:10 paulo-ferraz-oliveira

This was basically inspired by Elixir's way of using compile_env (though not directly related to it).

paulo-ferraz-oliveira avatar Oct 10 '23 21:10 paulo-ferraz-oliveira