Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(cop): add Platanus/EnvInModule cop #13

Merged
merged 1 commit into from
May 12, 2023
Merged

Conversation

nicolasguridi
Copy link
Contributor

@nicolasguridi nicolasguridi commented Apr 21, 2023

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() o ENV[] en cualquier archivo dentro de la carpeta app

En particular hay que revisar

Que quede claro cuál es la ofensa y cuál debiera ser la solución

@nicolasguridi nicolasguridi marked this pull request as draft April 24, 2023 20:43
@nicolasguridi nicolasguridi marked this pull request as ready for review May 12, 2023 13:20
@nicolasguridi nicolasguridi requested a review from ldlsegovia May 12, 2023 13:24
Copy link
Contributor

@ldlsegovia ldlsegovia left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

impecable 👏🏻

@nicolasguridi nicolasguridi merged commit 15cacbb into master May 12, 2023
@nicolasguridi nicolasguridi deleted the feat/env-in-module branch May 12, 2023 18:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

2 participants