Permalink
Browse files

Enforce Style/FrozenStringLiteralComment. (#6265)

Merge pull request 6265
  • Loading branch information...
parkr authored and jekyllbot committed Aug 4, 2017
1 parent f9f05e3 commit 7cf5f51ca287aa5903eaec807f24c88ddfbd115a
Showing with 264 additions and 12 deletions.
  1. +4 −0 .rubocop.yml
  2. +2 −0 Gemfile
  3. +2 −0 Rakefile
  4. +2 −0 exe/jekyll
  5. +2 −0 features/step_definitions.rb
  6. +2 −0 features/support/formatter.rb
  7. +4 −1 features/support/helpers.rb
  8. +1 −0 jekyll.gemspec
  9. +5 −2 lib/jekyll.rb
  10. +2 −0 lib/jekyll/cleaner.rb
  11. +2 −0 lib/jekyll/collection.rb
  12. +2 −0 lib/jekyll/command.rb
  13. +2 −0 lib/jekyll/commands/build.rb
  14. +2 −0 lib/jekyll/commands/clean.rb
  15. +2 −0 lib/jekyll/commands/doctor.rb
  16. +2 −0 lib/jekyll/commands/help.rb
  17. +2 −0 lib/jekyll/commands/new.rb
  18. +2 −0 lib/jekyll/commands/new_theme.rb
  19. +2 −0 lib/jekyll/commands/serve.rb
  20. +2 −0 lib/jekyll/commands/serve/servlet.rb
  21. +1 −0 lib/jekyll/configuration.rb
  22. +2 −0 lib/jekyll/converter.rb
  23. +2 −0 lib/jekyll/converters/identity.rb
  24. +2 −0 lib/jekyll/converters/markdown.rb
  25. +2 −0 lib/jekyll/converters/markdown/rdiscount_parser.rb
  26. +3 −3 lib/jekyll/converters/markdown/redcarpet_parser.rb
  27. +2 −0 lib/jekyll/converters/smartypants.rb
  28. +1 −0 lib/jekyll/convertible.rb
  29. +2 −0 lib/jekyll/deprecator.rb
  30. +1 −0 lib/jekyll/document.rb
  31. +1 −0 lib/jekyll/drops/collection_drop.rb
  32. +1 −0 lib/jekyll/drops/document_drop.rb
  33. +1 −0 lib/jekyll/drops/drop.rb
  34. +1 −0 lib/jekyll/drops/excerpt_drop.rb
  35. +1 −0 lib/jekyll/drops/jekyll_drop.rb
  36. +1 −0 lib/jekyll/drops/site_drop.rb
  37. +2 −0 lib/jekyll/drops/static_file_drop.rb
  38. +1 −0 lib/jekyll/drops/unified_payload_drop.rb
  39. +1 −0 lib/jekyll/drops/url_drop.rb
  40. +2 −0 lib/jekyll/entry_filter.rb
  41. +2 −0 lib/jekyll/errors.rb
  42. +3 −1 lib/jekyll/excerpt.rb
  43. +2 −0 lib/jekyll/external.rb
  44. +2 −0 lib/jekyll/filters.rb
  45. +2 −0 lib/jekyll/filters/grouping_filters.rb
  46. +2 −0 lib/jekyll/filters/url_filters.rb
  47. +2 −0 lib/jekyll/frontmatter_defaults.rb
  48. +2 −0 lib/jekyll/generator.rb
  49. +2 −0 lib/jekyll/hooks.rb
  50. +2 −0 lib/jekyll/layout.rb
  51. +2 −0 lib/jekyll/liquid_extensions.rb
  52. +2 −0 lib/jekyll/liquid_renderer.rb
  53. +2 −0 lib/jekyll/liquid_renderer/file.rb
  54. +5 −3 lib/jekyll/liquid_renderer/table.rb
  55. +2 −0 lib/jekyll/log_adapter.rb
  56. +2 −0 lib/jekyll/page.rb
  57. +2 −0 lib/jekyll/plugin.rb
  58. +2 −0 lib/jekyll/plugin_manager.rb
  59. +2 −0 lib/jekyll/publisher.rb
  60. +1 −0 lib/jekyll/reader.rb
  61. +2 −0 lib/jekyll/readers/collection_reader.rb
  62. +2 −0 lib/jekyll/readers/data_reader.rb
  63. +2 −0 lib/jekyll/readers/layout_reader.rb
  64. +2 −0 lib/jekyll/readers/page_reader.rb
  65. +2 −0 lib/jekyll/readers/post_reader.rb
  66. +2 −0 lib/jekyll/readers/static_file_reader.rb
  67. +2 −0 lib/jekyll/readers/theme_assets_reader.rb
  68. +2 −0 lib/jekyll/regenerator.rb
  69. +2 −0 lib/jekyll/related_posts.rb
  70. +1 −0 lib/jekyll/renderer.rb
  71. +1 −0 lib/jekyll/site.rb
  72. +2 −0 lib/jekyll/static_file.rb
  73. +2 −0 lib/jekyll/stevenson.rb
  74. +2 −0 lib/jekyll/tags/highlight.rb
  75. +1 −0 lib/jekyll/tags/include.rb
  76. +2 −0 lib/jekyll/tags/link.rb
  77. +2 −0 lib/jekyll/tags/post_url.rb
  78. +2 −0 lib/jekyll/theme.rb
  79. +2 −0 lib/jekyll/theme_builder.rb
  80. +3 −1 lib/jekyll/url.rb
  81. +6 −1 lib/jekyll/utils.rb
  82. +2 −0 lib/jekyll/utils/exec.rb
  83. +2 −0 lib/jekyll/utils/platforms.rb
  84. +2 −0 lib/jekyll/utils/win_tz.rb
  85. +2 −0 lib/jekyll/version.rb
  86. +2 −0 lib/theme_template/Gemfile
  87. +2 −0 rake/docs.rake
  88. +2 −0 rake/release.rake
  89. +2 −0 rake/site.rake
  90. +2 −0 test/fixtures/test-dependency-theme/test-dependency-theme.gemspec
  91. +2 −0 test/fixtures/test-theme/test-theme.gemspec
  92. +2 −0 test/helper.rb
  93. +2 −0 test/simplecov_custom_profile.rb
  94. +2 −0 test/source/_plugins/dummy.rb
  95. +2 −0 test/test_ansi.rb
  96. +2 −0 test/test_cleaner.rb
  97. +2 −0 test/test_coffeescript.rb
  98. +2 −0 test/test_collections.rb
  99. +2 −0 test/test_command.rb
  100. +2 −0 test/test_commands_serve.rb
  101. +2 −0 test/test_configuration.rb
  102. +2 −0 test/test_convertible.rb
  103. +2 −0 test/test_doctor_command.rb
  104. +2 −0 test/test_document.rb
  105. +2 −0 test/test_drop.rb
  106. +2 −0 test/test_entry_filter.rb
  107. +2 −0 test/test_excerpt.rb
  108. +2 −0 test/test_excerpt_drop.rb
  109. +1 −0 test/test_filters.rb
  110. +2 −0 test/test_front_matter_defaults.rb
  111. +2 −0 test/test_generated_site.rb
  112. +1 −0 test/test_kramdown.rb
  113. +2 −0 test/test_layout_reader.rb
  114. +2 −0 test/test_liquid_extensions.rb
  115. +2 −0 test/test_liquid_renderer.rb
  116. +2 −0 test/test_log_adapter.rb
  117. +2 −0 test/test_new_command.rb
  118. +2 −0 test/test_page.rb
  119. +2 −0 test/test_path_sanitization.rb
  120. +2 −0 test/test_plugin_manager.rb
  121. +2 −0 test/test_rdiscount.rb
  122. +2 −0 test/test_redcarpet.rb
  123. +2 −0 test/test_regenerator.rb
  124. +2 −0 test/test_related_posts.rb
  125. +2 −0 test/test_sass.rb
  126. +2 −0 test/test_site.rb
  127. +2 −0 test/test_site_drop.rb
  128. +2 −0 test/test_static_file.rb
  129. +1 −0 test/test_tags.rb
  130. +2 −0 test/test_theme.rb
  131. +2 −0 test/test_theme_assets_reader.rb
  132. +2 −0 test/test_url.rb
  133. +2 −0 test/test_utils.rb
View
@@ -9,6 +9,7 @@ AllCops:
- benchmark/**/*
- script/**/*
- vendor/**/*
- tmp/**/*
Layout/AlignArray:
Enabled: false
Layout/AlignHash:
@@ -99,6 +100,9 @@ Style/BracesAroundHashParameters:
Enabled: false
Style/ClassAndModuleChildren:
Enabled: false
Style/FrozenStringLiteralComment:
Enabled: true
EnforcedStyle: always
Style/Documentation:
Enabled: false
Exclude:
View
@@ -1,3 +1,5 @@
# frozen_string_literal: true
source "https://rubygems.org"
gemspec :name => "jekyll"
View
@@ -1,3 +1,5 @@
# frozen_string_literal: true
require "rubygems"
require "rake"
require "rdoc"
View
@@ -1,4 +1,6 @@
#!/usr/bin/env ruby
# frozen_string_literal: true
STDOUT.sync = true
$LOAD_PATH.unshift File.expand_path("../lib", __dir__)
@@ -1,3 +1,5 @@
# frozen_string_literal: true
Before do
FileUtils.rm_rf(Paths.test_dir) if Paths.test_dir.exist?
FileUtils.mkdir_p(Paths.test_dir) unless Paths.test_dir.directory?
@@ -1,3 +1,5 @@
# frozen_string_literal: true
require "fileutils"
require "colorator"
require "cucumber/formatter/console"
@@ -1,3 +1,5 @@
# frozen_string_literal: true
require "fileutils"
require "jekyll"
require "time"
@@ -107,7 +109,8 @@ def run_in_shell(*args)
File.write(Paths.status_file, p.exitstatus)
File.open(Paths.output_file, "wb") do |f|
f.puts "$ " << args.join(" ")
f.print "$ "
f.puts args.join(" ")
f.puts output
f.puts "EXIT STATUS: #{p.exitstatus}"
end
View
@@ -1,4 +1,5 @@
# coding: utf-8
# frozen_string_literal: true
lib = File.expand_path("lib", __dir__)
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
View
@@ -1,3 +1,5 @@
# frozen_string_literal: true
$LOAD_PATH.unshift __dir__ # For use/testing when no gem is installed
# Require all of the Ruby files in the given directory.
@@ -162,8 +164,9 @@ def sites
def sanitized_path(base_directory, questionable_path)
return base_directory if base_directory.eql?(questionable_path)
questionable_path.insert(0, "/") if questionable_path.start_with?("~")
clean_path = File.expand_path(questionable_path, "/")
clean_path = questionable_path.dup
clean_path.insert(0, "/") if clean_path.start_with?("~")
clean_path = File.expand_path(clean_path, "/")
return clean_path if clean_path.eql?(base_directory)
View
@@ -1,3 +1,5 @@
# frozen_string_literal: true
require "set"
module Jekyll
View
@@ -1,3 +1,5 @@
# frozen_string_literal: true
module Jekyll
class Collection
attr_reader :site, :label, :metadata
View
@@ -1,3 +1,5 @@
# frozen_string_literal: true
module Jekyll
class Command
class << self
@@ -1,3 +1,5 @@
# frozen_string_literal: true
module Jekyll
module Commands
class Build < Command
@@ -1,3 +1,5 @@
# frozen_string_literal: true
module Jekyll
module Commands
class Clean < Command
@@ -1,3 +1,5 @@
# frozen_string_literal: true
require "addressable/uri"
module Jekyll
@@ -1,3 +1,5 @@
# frozen_string_literal: true
module Jekyll
module Commands
class Help < Command
@@ -1,3 +1,5 @@
# frozen_string_literal: true
require "erb"
module Jekyll
@@ -1,3 +1,5 @@
# frozen_string_literal: true
require "erb"
class Jekyll::Commands::NewTheme < Jekyll::Command
@@ -1,3 +1,5 @@
# frozen_string_literal: true
module Jekyll
module Commands
class Serve < Command
@@ -1,3 +1,5 @@
# frozen_string_literal: true
require "webrick"
module Jekyll
@@ -1,4 +1,5 @@
# encoding: UTF-8
# frozen_string_literal: true
module Jekyll
class Configuration < Hash
View
@@ -1,3 +1,5 @@
# frozen_string_literal: true
module Jekyll
class Converter < Plugin
# Public: Get or set the highlighter prefix. When an argument is specified,
@@ -1,3 +1,5 @@
# frozen_string_literal: true
module Jekyll
module Converters
class Identity < Converter
@@ -1,3 +1,5 @@
# frozen_string_literal: true
module Jekyll
module Converters
class Markdown < Converter
@@ -1,3 +1,5 @@
# frozen_string_literal: true
module Jekyll
module Converters
class Markdown
@@ -1,3 +1,5 @@
# frozen_string_literal: true
class Jekyll::Converters::Markdown::RedcarpetParser
module CommonMethods
def add_code_tags(code, lang)
@@ -48,9 +50,7 @@ module WithRouge
def block_code(code, lang)
code = "<pre>#{super}</pre>"
output = "<div class=\"highlight\">"
output << add_code_tags(code, lang)
output << "</div>"
"<div class=\"highlight\">#{add_code_tags(code, lang)}</div>"
end
protected
@@ -1,3 +1,5 @@
# frozen_string_literal: true
class Kramdown::Parser::SmartyPants < Kramdown::Parser::Kramdown
def initialize(source, options)
super
@@ -1,4 +1,5 @@
# encoding: UTF-8
# frozen_string_literal: true
require "set"
View
@@ -1,3 +1,5 @@
# frozen_string_literal: true
module Jekyll
module Deprecator
extend self
View
@@ -1,4 +1,5 @@
# encoding: UTF-8
# frozen_string_literal: true
module Jekyll
class Document
@@ -1,4 +1,5 @@
# encoding: UTF-8
# frozen_string_literal: true
module Jekyll
module Drops
@@ -1,4 +1,5 @@
# encoding: UTF-8
# frozen_string_literal: true
module Jekyll
module Drops
View
@@ -1,4 +1,5 @@
# encoding: UTF-8
# frozen_string_literal: true
module Jekyll
module Drops
@@ -1,4 +1,5 @@
# encoding: UTF-8
# frozen_string_literal: true
module Jekyll
module Drops
@@ -1,4 +1,5 @@
# encoding: UTF-8
# frozen_string_literal: true
module Jekyll
module Drops
@@ -1,4 +1,5 @@
# encoding: UTF-8
# frozen_string_literal: true
module Jekyll
module Drops
@@ -1,3 +1,5 @@
# frozen_string_literal: true
module Jekyll
module Drops
class StaticFileDrop < Drop
@@ -1,4 +1,5 @@
# encoding: UTF-8
# frozen_string_literal: true
module Jekyll
module Drops
@@ -1,4 +1,5 @@
# encoding: UTF-8
# frozen_string_literal: true
module Jekyll
module Drops
@@ -1,3 +1,5 @@
# frozen_string_literal: true
module Jekyll
class EntryFilter
attr_reader :site
View
@@ -1,3 +1,5 @@
# frozen_string_literal: true
module Jekyll
module Errors
FatalException = Class.new(::RuntimeError)
View
@@ -1,3 +1,5 @@
# frozen_string_literal: true
module Jekyll
class Excerpt
extend Forwardable
@@ -117,7 +119,7 @@ def extract_excerpt(doc_content)
if tail.empty?
head
else
"" << head << "\n\n" << tail.scan(%r!^ {0,3}\[[^\]]+\]:.+$!).join("\n")
head.to_s.dup << "\n\n" << tail.scan(%r!^ {0,3}\[[^\]]+\]:.+$!).join("\n")
end
end
end
View
@@ -1,3 +1,5 @@
# frozen_string_literal: true
module Jekyll
module External
class << self
View
@@ -1,3 +1,5 @@
# frozen_string_literal: true
require "addressable/uri"
require "json"
require "date"
@@ -1,3 +1,5 @@
# frozen_string_literal: true
module Jekyll
module Filters
module GroupingFilters
@@ -1,3 +1,5 @@
# frozen_string_literal: true
require "addressable/uri"
module Jekyll
@@ -1,3 +1,5 @@
# frozen_string_literal: true
module Jekyll
# This class handles custom defaults for YAML frontmatter settings.
# These are set in _config.yml and apply both to internal use (e.g. layout)
View
@@ -1,3 +1,5 @@
# frozen_string_literal: true
module Jekyll
Generator = Class.new(Plugin)
end
View
@@ -1,3 +1,5 @@
# frozen_string_literal: true
module Jekyll
module Hooks
DEFAULT_PRIORITY = 20
View
@@ -1,3 +1,5 @@
# frozen_string_literal: true
module Jekyll
class Layout
include Convertible
@@ -1,3 +1,5 @@
# frozen_string_literal: true
module Jekyll
module LiquidExtensions
@@ -1,3 +1,5 @@
# frozen_string_literal: true
require "jekyll/liquid_renderer/file"
require "jekyll/liquid_renderer/table"
@@ -1,3 +1,5 @@
# frozen_string_literal: true
module Jekyll
class LiquidRenderer
class File
Oops, something went wrong.

0 comments on commit 7cf5f51

Please sign in to comment.