Foodcritic / foodcritic

Lint tool for Chef cookbooks.
http://foodcritic.io
MIT License
407 stars 153 forks source link

FC078 failure even though license is 'All Rights reserved' - FC 11.3 #657

Open kidharb opened 7 years ago

kidharb commented 7 years ago

This is related to Issue #609 and was seen on FC 11.2 and 11.3

$ foodcritic .
Checking 10 files
x.........
FC078: Ensure cookbook shared under an OSI-approved open source license: ./metadata.rb:1

$ foodcritic --version
foodcritic 11.3.0

$ cat metadata.rb | grep license
license 'All Rights Reserved'
coderanger commented 7 years ago

Unless you have a .foodcritic file somehow re-enabling the rule, it should be off by default. The rule requires the use of an open-source license, and is mostly intended for use with the Supermarket cookbook quality check, you can disable it for cookbooks not intended to be open-source.

kidharb commented 7 years ago

There is no .foodcritic file in my cookbook and a foodcritic -l reveals that all rules FC001 - FC0092 are enabled.

kidharb commented 7 years ago

Correction to above. Not all rules are enabled.

FC0003, FC023, FC035, FC036 .... are disabled.

FC078 is enabled though.

kidharb commented 7 years ago

I added an exception for FC078 in .foodcritic to work-around this issue for now.

americanhanko commented 7 years ago

Same issue here. Here are the contents of my .foodcritic file, which resolved the issue for me:

$ cat .foodcritic
~FC078
stefanwb commented 7 years ago

I might be missing the point here but 'All Rights Reserved' is not an OSI-approved nor standardised license according to https://spdx.org/licenses/, is it?

atheiman commented 6 years ago

@stefanwb the point is why is that running against all cookbooks, it is expected this will fail for any enterprise internal cookbook

sbrar7 commented 6 years ago

The issue still exists in the latest version12.3.0

stefanwb commented 6 years ago

@stefanwb the point is why is that running against all cookbooks, it is expected this will fail for any enterprise internal cookbook

Thanks for your repsonse. I did miss the point :)

However, shouldn't you run it with -t ~opensource for internal enterprise cookbooks then?

Also it seems dat FC069 does allow the 'All Rights Reserved' as a "license".. even though it is not. So a better exclusion in this case might be -t ~license

webchi commented 5 years ago

Still have it in 14.3.0

Raboo commented 5 years ago

It makes no sense in having a rule that forces people to do a exclusion for every internal/private cookbook. There are plenty of reasons for a cookbook to not be public, for instance being a wrapper cookbook.

I vote that if metadata contains any of the following

license          'All Rights Reserved'
privacy          true

then it should exclude FC0078

Arpanbhagat5 commented 5 years ago

Upvote for @Raboo's proposal. 👍