Skip to content

Commit 8e42632

Browse files
committed
[DOCS] Generator: Run Rubocop from Ruby instead of calling system
1 parent c86b154 commit 8e42632

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

rake_tasks/doc_generator.rake

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -82,8 +82,12 @@ namespace :docs do
8282
File.open('temp.rb', 'w') do |f|
8383
f.puts code
8484
end
85-
# Format code:
86-
system("rubocop --config #{__dir__}/docs_rubocop_config.yml -o /dev/null -a ./temp.rb")
85+
# Format code with Rubocop
86+
require 'rubocop'
87+
options = "--config #{__dir__}/docs_rubocop_config.yml -o /dev/null -a ./temp.rb".split
88+
cli = RuboCop::CLI.new
89+
cli.run(options)
90+
8791
# Read it back
8892
template = File.read('./temp.rb')
8993
File.delete('./temp.rb')

0 commit comments

Comments
 (0)