Enabled frozen string literals (#1154)

* Enabled frozen string literals

* Update rubocop config

* Prefer string interpolation in simple cases

Co-Authored-By: Dylan Thacker-Smith <[email protected]>
This commit is contained in:
Mike Angell
2019-09-18 13:19:45 +10:00
committed by GitHub
co-authored by Dylan Thacker-Smith
parent 1dcad34b06
commit 0d26f05bb8
121 changed files with 379 additions and 150 deletions
+2
View File
@@ -1,3 +1,5 @@
# frozen_string_literal: true
require 'benchmark/ips'
require_relative 'theme_runner'
+2
View File
@@ -1,3 +1,5 @@
# frozen_string_literal: true
require 'stackprof'
require_relative 'theme_runner'
+2
View File
@@ -1,3 +1,5 @@
# frozen_string_literal: true
class CommentForm < Liquid::Block
Syntax = /(#{Liquid::VariableSignature}+)/
+2
View File
@@ -1,3 +1,5 @@
# frozen_string_literal: true
require 'yaml'
module Database
+2
View File
@@ -1,3 +1,5 @@
# frozen_string_literal: true
require 'json'
module JsonFilter
+2
View File
@@ -1,3 +1,5 @@
# frozen_string_literal: true
$LOAD_PATH.unshift(__dir__ + '/../../lib')
require_relative '../../lib/liquid'
+2
View File
@@ -1,3 +1,5 @@
# frozen_string_literal: true
module MoneyFilter
def money_with_currency(money)
return '' if money.nil?
+2
View File
@@ -1,3 +1,5 @@
# frozen_string_literal: true
class Paginate < Liquid::Block
Syntax = /(#{Liquid::QuotedFragment})\s*(by\s*(\d+))?/
+2
View File
@@ -1,3 +1,5 @@
# frozen_string_literal: true
module ShopFilter
def asset_url(input)
"/files/1/[shop_id]/[shop_id]/assets/#{input}"
+2
View File
@@ -1,3 +1,5 @@
# frozen_string_literal: true
module TagFilter
def link_to_tag(label, tag)
"<a title=\"Show tag #{tag}\" href=\"/collections/#{@context['handle']}/#{tag}\">#{label}</a>"
+2
View File
@@ -1,3 +1,5 @@
# frozen_string_literal: true
module WeightFilter
def weight(grams)
format("%.2f", grams / 1000)
+2
View File
@@ -1,3 +1,5 @@
# frozen_string_literal: true
# This profiler run simulates Shopify.
# We are looking in the tests directory for liquid files and render them within the designated layout file.
# We will also export a substantial database to liquid which the templates can render values of.