Skip to content

Commit 8ae8753

Browse files
committed
Add frozen_string_literal comments
This ensures we're set up for the eventual migration to Ruby 3, which will enforce immutable strings by default. We keep the explicit calls to `#freeze` since Ruby versions older than 2.3 won't respect this magic comment.
1 parent 9893350 commit 8ae8753

File tree

5 files changed

+10
-0
lines changed

5 files changed

+10
-0
lines changed

lib/overcommit/constants.rb

+2
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
# frozen_string_literal: true
2+
13
# Global application constants.
24
module Overcommit
35
HOME = File.expand_path(File.join(File.dirname(__FILE__), '..', '..')).freeze

lib/overcommit/hook/pre_commit/berksfile_check.rb

+2
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
# frozen_string_literal: true
2+
13
module Overcommit::Hook::PreCommit
24
# Check if local Berksfile.lock matches Berksfile when either changes, unless
35
# Berksfile.lock is ignored by git.

lib/overcommit/hook/pre_commit/bundle_check.rb

+2
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
# frozen_string_literal: true
2+
13
module Overcommit::Hook::PreCommit
24
# Check if local Gemfile.lock matches Gemfile when either changes, unless
35
# Gemfile.lock is ignored by git.

lib/overcommit/message_processor.rb

+2
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
# frozen_string_literal: true
2+
13
module Overcommit
24
# Utility class that encapsulates the handling of hook messages and whether
35
# they affect lines the user has modified or not.

lib/overcommit/version.rb

+2
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
# frozen_string_literal: true
2+
13
# Defines the gem version.
24
module Overcommit
35
VERSION = '0.30.0'.freeze

0 commit comments

Comments
 (0)