Created
May 24, 2024 16:59
-
-
Save paul/7da6e74efa3a682c4e0aa5885b18915c to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Auto-correct files that get generated | |
g.after_generate do |files| | |
parsable_files = files.filter { |file| File.exist?(file) && file.end_with?(".rb") } | |
unless parsable_files.empty? | |
system("bundle", "exec", | |
"rubocop", | |
"--autocorrect-all", | |
"--fail-level=E", | |
"--format=quiet", | |
*parsable_files, | |
exception: true) | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Originally from https://ruby.social/@kotogavr/112495584388210864
I made it copy/pastable, and let it handle "pretend" mode with
File.exists?
.