standardrb / standard-rails

A Standard Ruby plugin that configures rubocop-rails
MIT License
163 stars 15 forks source link

Autofix is not working #26

Closed xdmx closed 1 month ago

xdmx commented 8 months ago

I've been using Standard for a while and giving Standard Rails a try to evaluate the rules.

I usually rely on --fix to fix all warnings and that always works on Standard, but it seems that it doesn't for the Rails plugin, I see the warnings, and they're marked as "Correctable", but after running it with --fix it doesn't fix them (it says that they can be corrected with rubocop -A, but then it wouldn't use the Standard Rails rules)

searls commented 8 months ago

Does --fix-unsafely work? https://github.com/standardrb/standard#applying-unsafe-fixes

xdmx commented 8 months ago

Yes, it does. Interestingly --fix wouldn't fix any, while the unsafe one was able to fix a bunch. The safe one didn't even for apparently safe code like users.map { |u| u[:email] } -> users.pluck(:email)

searls commented 1 month ago

Closing due to inactivity / failure to reproduce