Class: RuboCop::Cop::Legion::Llm::SettingsAccessPath
- Inherits:
-
Base
- Object
- Base
- RuboCop::Cop::Legion::Llm::SettingsAccessPath
- Defined in:
- lib/rubocop/cop/legion/llm/settings_access_path.rb
Overview
Flags direct write-path access to ‘Legion::Settings.loader.settings[…]` outside test files. Production code must use `Legion::Settings.dig(…)` so all reads go through the typed, validated accessor.
Constant Summary collapse
- MSG =
'Use `Legion::Settings.dig(...)` instead of ' \ '`Legion::Settings.loader.settings[...][...]`.'
Instance Method Summary collapse
Instance Method Details
#on_send(node) ⇒ Object
22 23 24 25 26 |
# File 'lib/rubocop/cop/legion/llm/settings_access_path.rb', line 22 def on_send(node) return unless loader_settings_chain?(node) add_offense(node) end |