Skip to content

Commit

Permalink
Move the conflicts cop as well
Browse files Browse the repository at this point in the history
Signed-off-by: Tim Smith <tsmith@chef.io>
  • Loading branch information
tas50 committed Dec 7, 2019
1 parent e4741cf commit b332c0a
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@
module RuboCop
module Cop
module Chef
module ChefDeprecations
# Don't use the deprecated 'conflicts' metadata value
module ChefModernize
# The conflicts metadata.rb method is not used and is unnecessary in cookbooks.
#
# @example
#
Expand All @@ -28,7 +28,7 @@ module ChefDeprecations
# conflicts "another_cookbook"
#
class ConflictsMetadata < Cop
MSG = "Don't use the deprecated 'conflicts' metadata value".freeze
MSG = "The conflicts metadata.rb method is not used and is unnecessary in cookbooks.".freeze

def on_send(node)
add_offense(node, location: :expression, message: MSG, severity: :refactor) if node.method_name == :conflicts
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,13 +16,13 @@

require 'spec_helper'

describe RuboCop::Cop::Chef::ChefDeprecations::ConflictsMetadata, :config do
describe RuboCop::Cop::Chef::ChefModernize::ConflictsMetadata, :config do
subject(:cop) { described_class.new(config) }

it 'registers an offense when metadata uses "conflicts"' do
expect_offense(<<~RUBY)
conflicts 'foo'
^^^^^^^^^^^^^^^ Don't use the deprecated 'conflicts' metadata value
^^^^^^^^^^^^^^^ The conflicts metadata.rb method is not used and is unnecessary in cookbooks.
RUBY

expect_correction("\n")
Expand Down

0 comments on commit b332c0a

Please sign in to comment.