Skip to content

Commit

Permalink
Update documentation to fix Rubocop errors in 'rails generate' command
Browse files Browse the repository at this point in the history
Previously, the 'rails generate' command would send unsupported files to
Rubocop,causing errors and failures in the process.
To fix this, we added a filter that only sends parsable
files to Rubocop.

This commit updates the documentation to reflect this change,
helping users avoid errors and complete
'rails generate' command successfully.

Follow-up to rubocop#961 and rubocop#956
  • Loading branch information
tmaier committed Apr 12, 2023
1 parent 73fd423 commit fcfe286
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
3 changes: 2 additions & 1 deletion README.md
Expand Up @@ -71,7 +71,8 @@ your config/application.rb to apply RuboCop autocorrection to code generated by
module YourCoolApp
class Application < Rails::Application
config.generators.after_generate do |files|
system("bundle exec rubocop -A --fail-level=E #{files.shelljoin}", exception: true)
parsable_files = files.filter { |file| file.end_with?('.rb') }
system("bundle exec rubocop -A --fail-level=E #{parsable_files.shelljoin}", exception: true)
end
end
end
Expand Down
3 changes: 2 additions & 1 deletion docs/modules/ROOT/pages/usage.adoc
Expand Up @@ -41,7 +41,8 @@ your config/application.rb to apply RuboCop autocorretion to code generated by `
module YourCoolApp
class Application < Rails::Application
config.generators.after_generate do |files|
system("bundle exec rubocop -A --fail-level=E #{files.shelljoin}", exception: true)
parsable_files = files.filter { |file| file.end_with?('.rb') }
system("bundle exec rubocop -A --fail-level=E #{parsable_files.shelljoin}", exception: true)
end
end
end
Expand Down

0 comments on commit fcfe286

Please sign in to comment.