Skip to content

Commit f5c9e30

Browse files
committed
Update documentation to fix Rubocop errors in 'rails generate' command
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 #961 and #956
1 parent 73fd423 commit f5c9e30

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

README.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,8 @@ your config/application.rb to apply RuboCop autocorrection to code generated by
7171
module YourCoolApp
7272
class Application < Rails::Application
7373
config.generators.after_generate do |files|
74-
system("bundle exec rubocop -A --fail-level=E #{files.shelljoin}", exception: true)
74+
parsable_files = files.filter { |file| file.end_with?('.rb') }
75+
system("bundle exec rubocop -A --fail-level=E #{parsable_files.shelljoin}", exception: true)
7576
end
7677
end
7778
end

docs/modules/ROOT/pages/usage.adoc

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,8 @@ your config/application.rb to apply RuboCop autocorretion to code generated by `
4141
module YourCoolApp
4242
class Application < Rails::Application
4343
config.generators.after_generate do |files|
44-
system("bundle exec rubocop -A --fail-level=E #{files.shelljoin}", exception: true)
44+
parsable_files = files.filter { |file| file.end_with?('.rb') }
45+
system("bundle exec rubocop -A --fail-level=E #{parsable_files.shelljoin}", exception: true)
4546
end
4647
end
4748
end

0 commit comments

Comments
 (0)