Skip to content

Commit e1b0cee

Browse files
committed
Break cache if Gemfile.lock or .rubocop.yml change.
1 parent a9c1e64 commit e1b0cee

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

lib/erb_lint/cache.rb

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,8 @@ def initialize(config, cache_dir = nil)
99
@cache_dir = cache_dir || CACHE_DIRECTORY
1010
@hits = []
1111
@new_results = []
12+
@gemfile_lock = File.read("Gemfile.lock") if File.exist?("Gemfile.lock")
13+
@rubocop_config = File.read(".rubocop.yml") if File.exist?(".rubocop.yml")
1214
puts "Cache mode is on"
1315
end
1416

@@ -76,7 +78,7 @@ def checksum(filename, file_content)
7678
mode = File.stat(filename).mode
7779

7880
digester.update(
79-
"#{mode}#{config.to_hash}#{ERBLint::VERSION}#{file_content}",
81+
"#{mode}#{config.to_hash}#{ERBLint::VERSION}#{@rubocop_config}#{@gemfile_lock}#{file_content}",
8082
)
8183
digester.hexdigest
8284
rescue Errno::ENOENT

0 commit comments

Comments
 (0)