diff --git a/lib/erb_lint/cache.rb b/lib/erb_lint/cache.rb index 7746765..818e1c4 100644 --- a/lib/erb_lint/cache.rb +++ b/lib/erb_lint/cache.rb @@ -9,6 +9,8 @@ def initialize(config, cache_dir = nil) @cache_dir = cache_dir || CACHE_DIRECTORY @hits = [] @new_results = [] + @gemfile_lock = File.read("Gemfile.lock") if File.exist?("Gemfile.lock") + @rubocop_config = File.read(".rubocop.yml") if File.exist?(".rubocop.yml") puts "Cache mode is on" end @@ -76,7 +78,7 @@ def checksum(filename, file_content) mode = File.stat(filename).mode digester.update( - "#{mode}#{config.to_hash}#{ERBLint::VERSION}#{file_content}", + "#{mode}#{config.to_hash}#{ERBLint::VERSION}#{@rubocop_config}#{@gemfile_lock}#{file_content}", ) digester.hexdigest rescue Errno::ENOENT