Skip to content
This repository was archived by the owner on Nov 30, 2024. It is now read-only.

Commit 7be928d

Browse files
committed
Merge pull request #586 from technicalpickles/frozen-string-literals
Reduce memory usage by using frozen string literals
1 parent 68b8508 commit 7be928d

35 files changed

+72
-7
lines changed

.rubocop.yml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,3 +31,9 @@ Lint/AssignmentInCondition:
3131
Exclude:
3232
# The pattern makes sense here
3333
- 'lib/rspec/support/mutex.rb'
34+
35+
Style/FrozenStringLiteralComment:
36+
Include:
37+
- lib/**/*.rb
38+
Layout/EmptyLineAfterMagicComment:
39+
Enabled: true

.rubocop_todo.yml

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -307,13 +307,6 @@ Style/FormatString:
307307
Exclude:
308308
- 'spec/rspec/support/encoded_string_spec.rb'
309309

310-
# Offense count: 68
311-
# Cop supports --auto-correct.
312-
# Configuration parameters: EnforcedStyle.
313-
# SupportedStyles: always, always_true, never
314-
Style/FrozenStringLiteralComment:
315-
Enabled: false
316-
317310
# Offense count: 1
318311
# Cop supports --auto-correct.
319312
Style/GlobalStdStream:

lib/rspec/support.rb

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
# frozen_string_literal: true
2+
13
module RSpec
24
module Support
35
# @api private

lib/rspec/support/caller_filter.rb

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
# frozen_string_literal: true
2+
13
RSpec::Support.require_rspec_support "ruby_features"
24

35
module RSpec

lib/rspec/support/comparable_version.rb

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
# frozen_string_literal: true
2+
13
module RSpec
24
module Support
35
# @private

lib/rspec/support/differ.rb

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
# frozen_string_literal: true
2+
13
RSpec::Support.require_rspec_support 'encoded_string'
24
RSpec::Support.require_rspec_support 'hunk_generator'
35
RSpec::Support.require_rspec_support "object_formatter"

lib/rspec/support/directory_maker.rb

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
# frozen_string_literal: true
2+
13
RSpec::Support.require_rspec_support 'ruby_features'
24

35
module RSpec

lib/rspec/support/encoded_string.rb

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
# frozen_string_literal: true
2+
13
module RSpec
24
module Support
35
# @private

lib/rspec/support/fuzzy_matcher.rb

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
# frozen_string_literal: true
2+
13
module RSpec
24
module Support
35
# Provides a means to fuzzy-match between two arbitrary objects.

lib/rspec/support/hunk_generator.rb

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
# frozen_string_literal: true
2+
13
require 'diff/lcs'
24
require 'diff/lcs/hunk'
35

0 commit comments

Comments
 (0)