Skip to content

Commit

Permalink
[Fix #12076] Explicitly require fileutils in RuboCop::Server::Cache
Browse files Browse the repository at this point in the history
The "fileutils.rb" item is dynamically added to the `$LOADED_FEATURES`
due to the autoloading when calling the `RuboCop::Server::Cache.dir`.

Explicit require is added to achieve idempotency when initializing
the `RuboCop::ResultCache.rubocop_required_features`.

This change resolves the issue where the top level cache folder was
named differently during two consecutive runs of rubocop.
  • Loading branch information
K-S-A authored and bbatsov committed Oct 11, 2023
1 parent b4e2bdd commit 4025422
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
* [#12076](https://github.com/rubocop/rubocop/issues/12076): Fixed an issue where the top-level cache folder was named differently during two consecutive rubocop runs. ([@K-S-A][])
1 change: 1 addition & 0 deletions lib/rubocop/server/cache.rb
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
# frozen_string_literal: true

require 'fileutils'
require 'pathname'
require_relative '../cache_config'
require_relative '../config_finder'
Expand Down

0 comments on commit 4025422

Please sign in to comment.