Skip to content

Commit a0b3739

Browse files
authored
Cache the reek configuration loading for faster execution (#510)
1 parent 98b4c70 commit a0b3739

File tree

2 files changed

+7
-1
lines changed

2 files changed

+7
-1
lines changed

CHANGELOG.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
* [CHANGE] Bump aruba, fakefs, minitest, mocha, reek, rubocop dependencies (by [@faisal][])
55
* [CHANGE] Add .solargraph.yml config file to enable Solargraph LSP use in editors such as BBedit (by [@faisal][])
66
* [CHANGE] Drop support for Ruby 2.7.x, 3.0.x (by [@faisal][])
7+
* [CHANGE] Cache the reek configuration loading for faster execution (by [@raff-s][])
78

89
# v4.9.1 / 2024-04-14 [(commits)](https://github.com/whitesmith/rubycritic/compare/v4.9.0...v4.9.1)
910

@@ -454,3 +455,4 @@
454455
[@Fito]: https://github.com/Fito
455456
[@fbuys]: https://github.com/fbuys
456457
[@exoego]: https://github.com/exoego
458+
[@raff-s]: https://github.com/raff-s

lib/rubycritic/analysers/helpers/reek.rb

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,12 @@
44

55
module RubyCritic
66
class Reek < ::Reek::Examiner
7+
def self.configuration
8+
@configuration ||= ::Reek::Configuration::AppConfiguration.from_default_path
9+
end
10+
711
def initialize(analysed_module)
8-
super(analysed_module, configuration: ::Reek::Configuration::AppConfiguration.from_default_path)
12+
super(analysed_module, configuration: self.class.configuration)
913
end
1014
end
1115
end

0 commit comments

Comments
 (0)