Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Loading…

FC022 block name check appears to be too simplistic #29

Closed
eherot opened this Issue · 5 comments

2 participants

Eric Herot Andrew Crump
Eric Herot

This code block triggers FC022:

deleted_users.each do |user_to_delete|

  user user_to_delete do
    action :remove
    only_if "/usr/bin/id #{user_to_delete} > /dev/null"
    supports :manage_home => true
  end

end

Even though ti appears to be correct. This one does not:

deleted_users.each do |user_to_delete|

  user "#{user_to_delete}" do
    action :remove
    only_if "/usr/bin/id #{user_to_delete} > /dev/null"
    supports :manage_home => true
  end

end

(although it does trigger FC002, as expected).

Andrew Crump
Owner

Hi Eric,

Thanks for reporting this and taking the time to give clear examples.

I'm suffering the effects of a cold at the moment but will look into this on the weekend.

Cheers,

Andrew.

Eric Herot

No worries! I'm at ChefConf this week anyway (Many lovers of Foodcritic here). But thanks for being such a loyal maintainer!

Andrew Crump
Owner

Thanks for contributing! The community around Chef is seriously awesome.

Andrew Crump acrmp referenced this issue from a commit
Andrew Crump FC022: Don't match name == block var, refs #29.
Rule previously matched incorrectly when the block var was given by itself as
the name of the resource.
254eeab
Andrew Crump
Owner

A fix for this has been released in 1.3.0. Please let me know if this resolves the issue for you.

Andrew Crump
Owner

Hi Eric,

Closing this one as resolved. Please let me know if it's still an issue and we'll re-open.

Cheers,

Andrew.

Andrew Crump acrmp closed this
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.