Skip to content
This repository has been archived by the owner on Sep 19, 2020. It is now read-only.

Rename FC045 since Chef 12 requires name metadata #399

Merged
merged 1 commit into from
Oct 28, 2015
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 7 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
## Unreleased

- Renamed FC045 from 'Consider setting cookbook name in metadata' to 'Metadata does not contain cookbook name' as Chef 12 requires name metadata
- Removed the annoyances tag from FC045 as it's not longer an annoyance, but instead a requirement
- Added DSL metadata for Chef 12.5.1

## 5.0.0 (17 September, 2015)

Features:
Expand Down Expand Up @@ -26,7 +32,7 @@ Bugfixes:
([related issue](https://github.com/acrmp/foodcritic/pull/313)).
- pinned moustache gem to 0.99 for ruby 1.9.3 compatibility
Thanks @jdmundrawala
- Added metadata for missing Chef 11 versions.
- Added metadata for missing Chef 11 versions.
Thanks @jdmundrawala
- [FC044: Avoid bare attribute keys](http://acrmp.github.com/foodcritic/#FC044) would fire on parameterized attributes.
Thanks @odcinek
Expand Down
2 changes: 1 addition & 1 deletion features/support/command_helpers.rb
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ def assertions
'FC042' => 'Prefer include_recipe to require_recipe',
'FC043' => 'Prefer new notification syntax',
'FC044' => 'Avoid bare attribute keys',
'FC045' => 'Consider setting cookbook name in metadata',
'FC045' => 'Metadata does not contain cookbook name',
'FC046' => 'Attribute assignment uses assign unless nil',
'FC047' => 'Attribute assignment does not specify precedence',
'FC048' => 'Prefer Mixlib::ShellOut',
Expand Down
4 changes: 2 additions & 2 deletions lib/foodcritic/rules.rb
Original file line number Diff line number Diff line change
Expand Up @@ -663,8 +663,8 @@ def pry_bindings(ast)
end
end

rule 'FC045', 'Consider setting cookbook name in metadata' do
tags %w(annoyances metadata)
rule 'FC045', 'Metadata does not contain cookbook name' do
tags %w(metadata)
metadata do |ast, filename|
unless ast.xpath('descendant::stmts_add/command/ident/@value="name"')
[file_match(filename)]
Expand Down
2 changes: 1 addition & 1 deletion spec/regression/expected-output.txt
Original file line number Diff line number Diff line change
Expand Up @@ -358,7 +358,7 @@ FC043: Prefer new notification syntax: ./tomcat/recipes/users.rb:22
FC043: Prefer new notification syntax: ./yum/providers/key.rb:60
FC043: Prefer new notification syntax: ./yum/providers/repository.rb:94
FC044: Avoid bare attribute keys: ./resolver/attributes/default.rb:20
FC045: Consider setting cookbook name in metadata: ./maven/metadata.rb:1
FC045: Metadata does not contain cookbook name: ./maven/metadata.rb:1
FC047: Attribute assignment does not specify precedence: ./jetty/recipes/cargo.rb:35
FC047: Attribute assignment does not specify precedence: ./users/providers/manage.rb:55
FC048: Prefer Mixlib::ShellOut: ./apt/providers/repository.rb:26
Expand Down