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

Support for a magic comment to temporarily disable a rule #259

Closed
nogweii opened this issue Aug 8, 2014 · 3 comments
Closed

Support for a magic comment to temporarily disable a rule #259

nogweii opened this issue Aug 8, 2014 · 3 comments
Assignees

Comments

@nogweii
Copy link

nogweii commented Aug 8, 2014

Given something like:

package 'openjdk-6-jre-lib' do
  action :install
end

package 'openjdk-6-jre' do
  action :install
end

include_recipe 'java'

This triggers FC005. Rightly so, but in this one particular case, I actually like the additional verbosity. I don't want to disable FC005 entirely in this cookbook, as I do want to be notified about violations in other recipes (or even elsewhere in the file). So I'm proposing this syntax (inspired by rubocop's):

# foodcritic:disable FC005
package 1 do
  # ...
end
package 2 do
  # ...
end
# foodcritic:enable FC005
@guillaume-brossard
Copy link

+1

@corniste01
Copy link

This would also help those of us who break the build on a foodcritic limit to mark issues that have an open foodcritic issue. The addition of an optional reason field would also allow us to explain why we're disabling a rule at that point. That would let us track back to the foodcritic issue and remove the disabling of the rule when it was fixed.

@odcinek odcinek self-assigned this Mar 31, 2015
@lamont-granquist
Copy link
Contributor

We should have this with # ~FC005 comments

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants