Class: RuboCop::Cop::InSpecStyle::OracleDbSessionPass
- Inherits:
-
RuboCop::Cop
- Object
- RuboCop::Cop
- RuboCop::Cop::InSpecStyle::OracleDbSessionPass
- Includes:
- MatchRange
- Defined in:
- lib/rubocop/cop/inspecstyle/oracle_db_session_pass.rb
Overview
Constant Summary collapse
- MSG =
'Use `:password` instead of `:pass`. This will be removed in '\ 'InSpec 5'
Instance Method Summary collapse
- #autocorrect(node) ⇒ Object
-
#on_send(node) ⇒ Object
Getting location was a bit tricky on this one, looking at docs perhaps convention does allow highlighting an entire line.
Instance Method Details
#autocorrect(node) ⇒ Object
39 40 41 42 43 |
# File 'lib/rubocop/cop/inspecstyle/oracle_db_session_pass.rb', line 39 def autocorrect(node) lambda do |corrector| corrector.replace(offense_range(node), preferred_replacement) end end |
#on_send(node) ⇒ Object
Getting location was a bit tricky on this one, looking at docs perhaps convention does allow highlighting an entire line.
34 35 36 37 |
# File 'lib/rubocop/cop/inspecstyle/oracle_db_session_pass.rb', line 34 def on_send(node) return unless result = oracledb_session_pass?(node) add_offense(node, message: MSG) end |