-
Notifications
You must be signed in to change notification settings - Fork 2
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
Corriger les warnings relevés par brakeman plutôt que de les ignorer #4245
Conversation
brakeman (5.3.1) | ||
brakeman (6.1.2) | ||
racc |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
J'ai lancé brakeman avant et après la MAJ, et il n'y a pas de nouvelles erreurs. 😉
mail.from %("#{domain.name}" <#{default_from}>) if mail.from.blank? | ||
mail.from(rfc5322_name_and_email(domain.name, default_from)) if mail.from.blank? | ||
end | ||
|
||
def rfc5322_name_and_email(name, email) | ||
%("#{name}" <#{email}>) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ce code est testé, on peut le voir en cherchant " <
dans les specs. 😉
= render @motifs | ||
= render partial: "admin/motifs/motif", collection: @motifs, as: :motif |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Voir https://brakemanscanner.org/docs/warning_types/dynamic_render_paths/
Ça nous coûte pas cher d'utiliser cette version explicite, c'est plus lisible à mes yeux et ça rassure brakeman.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Trop bien
(et c'est des petits trucs, mais remplacer page
par page_number
ça fait partie de ces gains de lisibilité qui font vraiment plaisir)
Le fichier
brakeman.ignore
contient une liste de warnings brakeman que nous avons observés et décidé d'ignorer.Je trouve que ce fichier :
Je corrige donc ici les warnings relevés et je supprime
brakeman.ignore
.Checklist
Avant la revue :
Revue :