diff options
Diffstat (limited to 'rubocop/cop/gitlab/feature_available_usage.rb')
-rw-r--r-- | rubocop/cop/gitlab/feature_available_usage.rb | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/rubocop/cop/gitlab/feature_available_usage.rb b/rubocop/cop/gitlab/feature_available_usage.rb index f748b7d9111..4dba4baf1e7 100644 --- a/rubocop/cop/gitlab/feature_available_usage.rb +++ b/rubocop/cop/gitlab/feature_available_usage.rb @@ -4,7 +4,7 @@ module RuboCop module Cop module Gitlab # Cop that checks for correct calling of #feature_available? - class FeatureAvailableUsage < RuboCop::Cop::Cop + class FeatureAvailableUsage < RuboCop::Cop::Base OBSERVED_METHOD = :feature_available? LICENSED_FEATURE_LITERAL_ARG_MSG = '`feature_available?` should not be called for features that can be licensed (`%s` given), use `licensed_feature_available?(feature)` instead.' LICENSED_FEATURE_DYNAMIC_ARG_MSG = "`feature_available?` should not be called for features that can be licensed (`%s` isn't a literal so we cannot say if it's legit or not), using `licensed_feature_available?(feature)` may be more appropriate." @@ -21,6 +21,7 @@ module RuboCop metrics_dashboard analytics operations + monitor security_and_compliance container_registry environments @@ -38,9 +39,9 @@ module RuboCop return if ALL_FEATURES.include?(feature_name(node)) && args_count(node) == 2 if !ALL_FEATURES.include?(feature_name(node)) - add_offense(node, location: :expression, message: licensed_feature_message(node)) + add_offense(node, message: licensed_feature_message(node)) elsif args_count(node) < 2 - add_offense(node, location: :expression, message: NOT_ENOUGH_ARGS_MSG) + add_offense(node, message: NOT_ENOUGH_ARGS_MSG) end end |