tasks/cops_documentation.rake in rubocop-minitest-0.10.0 vs tasks/cops_documentation.rake in rubocop-minitest-0.10.1
- old
+ new
@@ -57,11 +57,11 @@
cop_config.fetch('Safe', true) ? 'Yes' : 'No',
autocorrect,
cop_config.fetch('VersionAdded', '-'),
cop_config.fetch('VersionChanged', '-')
]]
- to_table(header, content) + "\n"
+ "#{to_table(header, content)}\n"
end
# rubocop:enable Metrics/MethodLength
def h2(title)
content = +"\n"
@@ -182,11 +182,10 @@
content << urls.map { |url| "* #{url}" }.join("\n")
content << "\n"
content
end
- # rubocop:disable Metrics/AbcSize
def print_cops_of_department(cops, department, config)
selected_cops = cops_of_department(cops, department).select do |cop|
cop.to_s.start_with?('RuboCop::Cop::Minitest')
end
return if selected_cops.empty?
@@ -197,13 +196,12 @@
content << print_cop_with_doc(cop, config)
end
file_name = "#{Dir.pwd}/docs/modules/ROOT/pages/cops_#{department.downcase}.adoc"
File.open(file_name, 'w') do |file|
puts "* generated #{file_name}"
- file.write(content.strip + "\n")
+ file.write("#{content.strip}\n")
end
end
- # rubocop:enable Metrics/AbcSize
def print_cop_with_doc(cop, config)
t = config.for_cop(cop)
non_display_keys = %w[
Description Enabled StyleGuide Reference Safe SafeAutoCorrect VersionAdded