Skip to content
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
Show file tree
Hide file tree
Showing 133 changed files with 264 additions and 12 deletions.
@@ -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:
@@ -1,3 +1,5 @@
# frozen_string_literal: true

source "https://rubygems.org"
gemspec :name => "jekyll"

@@ -1,3 +1,5 @@
# frozen_string_literal: true

require "rubygems"
require "rake"
require "rdoc"
@@ -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
@@ -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)
@@ -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)

@@ -1,3 +1,5 @@
# frozen_string_literal: true

require "set"

module Jekyll
@@ -1,3 +1,5 @@
# frozen_string_literal: true

module Jekyll
class Collection
attr_reader :site, :label, :metadata
@@ -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
@@ -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"

@@ -1,3 +1,5 @@
# frozen_string_literal: true

module Jekyll
module Deprecator
extend self
@@ -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
@@ -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
2