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

Fix flash before render and add custom cop #3201

Conversation

americodls
Copy link
Contributor

This PR introduces a custom cop to detect and prevent bugs like this one: #3149

Similar bugs were fixed as well in this PR.

Another PR was sent to rubocop-rails: rubocop/rubocop-rails#759

If that PR is accepted we can update the rubocop-rails version and delete the custom cop from this project.

@codecov
Copy link

codecov bot commented Aug 28, 2022

Codecov Report

Merging #3201 (65388f3) into master (f4e4bf7) will not change coverage.
The diff coverage is 100.00%.

@@           Coverage Diff           @@
##           master    #3201   +/-   ##
=======================================
  Coverage   98.18%   98.18%           
=======================================
  Files         110      110           
  Lines        3310     3310           
=======================================
  Hits         3250     3250           
  Misses         60       60           
Impacted Files Coverage Δ
app/controllers/api_keys_controller.rb 98.27% <100.00%> (ø)
app/controllers/multifactor_auths_controller.rb 100.00% <100.00%> (ø)
app/controllers/owners_controller.rb 98.03% <100.00%> (ø)

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

.rubocop.yml Outdated Show resolved Hide resolved
@americodls americodls force-pushed the fix-flash-before-render-and-add-custom-cop branch 2 times, most recently from 4b95efd to 8455929 Compare August 29, 2022 17:25
@simi
Copy link
Member

simi commented Aug 29, 2022

ℹ️ failing CI seems not related. I'll restart it later. Good job for now 💪.

@americodls americodls force-pushed the fix-flash-before-render-and-add-custom-cop branch from 8455929 to 65388f3 Compare August 29, 2022 17:55
@americodls
Copy link
Contributor Author

Hey @simi

Now the new version of rubocop-rails was released with the feature I've implemented based on our previous discussion that detects potential misuse of flash, I think we can close this PR and I can send other PR where:

  • rubocop-rails is upgraded to the latest version
  • .rubocop_todo.yml is regenerated
  • Rails/ActionControllerFlashBeforeRender offenses are fixed

After merging this new PR, all similar bugs to that one will be fixed and we must not see them anymore.

What do you think?

@americodls
Copy link
Contributor Author

@simi I just created the PR -> #3207

@americodls americodls closed this Sep 9, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants