feat(cop): add Platanus/EnvInModule cop #13
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Contexto
Hace un tiempo se agregó a la guía de estilo de Platanus la recomendación de que las variables de ambiente deben ser definidas como métodos en un módulo, para agruparlas y para que sea más fácil hacer mock de ellas.
En este PR de Potassium se explican las razones de esta recomendación y se implementa el módulo de variables de entorno en el generador de aplicaciones.
Qué se está haciendo
Se crea una cop que muestra un warning si se hace
ENV.fetch()
oENV[]
en cualquier archivo dentro de la carpetaapp
En particular hay que revisar
Que quede claro cuál es la ofensa y cuál debiera ser la solución