Add and apply Style/SingleLineMethods rubocop rule

Single line methods are hard to read, at least with this syntax. The
syntax used in Ruby 3.0 is accepted since Rubocop 1.7.0.
This commit is contained in:
Javi Martín
2021-08-11 17:02:31 +02:00
parent 48672a3f35
commit bbc3c2d7e7
2 changed files with 7 additions and 1 deletions

View File

@@ -517,6 +517,9 @@ Style/RedundantSelf:
Style/SafeNavigation:
Enabled: true
Style/SingleLineMethods:
Enabled: true
Style/SoleNestedConditional:
Enabled: true

View File

@@ -1,6 +1,9 @@
# not use compression
class SitemapGenerator::FileAdapter
def gzip(stream, data); stream.write(data); stream.close end
def gzip(stream, data)
stream.write(data)
stream.close
end
end
SitemapGenerator::Sitemap.namer = SitemapGenerator::SimpleNamer.new(:sitemap, extension: ".xml")