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

Add multiple attribute count metrics #669

Open
onlyhavecans opened this issue Oct 3, 2017 · 1 comment
Open

Add multiple attribute count metrics #669

onlyhavecans opened this issue Oct 3, 2017 · 1 comment

Comments

@onlyhavecans
Copy link

For quality metrics in supermarket and to encourage poor community cookbook behavior I would like to implement three new checks;

  • Greater than 20 attributes (disabled by default)
  • Greater than 50 attributes
  • Greater than 100 attributes

The reason this is broken into three checks is to show the increasing trouble to letting attribute's go out of control for community cookbooks.

@tas50
Copy link
Contributor

tas50 commented Nov 13, 2017

I'm going to post this same response to several issues since we have a theme going on here.

Foodcritic is a pretty versatile cookbook validation tool. You can use it out of the box to get helpful tips on your cookbooks, you can write your own rules, and it's used with Supermarket to enforce quality metrics. Those are 3 distinct use cases and these use cases often conflict with each other. Things we think are code smell within community cookbooks are just fine for private cookbooks. Take for instance the issues we had recently with enforcement of open source licenses and SPDX compliant license strings in the metadata.rb file. That ONLY matters if you're uploading to the Supermarket.

Two Possible solutions (pick one or both)

Supermarket only rules via tagging

So why ship Supermarket only rules with Foodcritic at all? Why not just create custom Supermarket rules we run locally there? Well I strongly believe that users should be able to run those same quality tests locally without significant effort. Requiring an external rules library is significant effort since we don't have a plugin sharing system in Foodcritic, and I have no interest in ever doing that. So what we need is a more formalized process for bringing those rules in and the understanding that we'll disable them by default. We also need to expose information on Supermarket showing how to run cookbooks locally with all these rules enabled. I'm curious what others think. I'd be open to creating disabled by default Foodcritic rules for anything that's been accepted to the cookbooks quality metrics repo first.

"Warning" only rules and a better config system

So the second solution is to create a better config system and use that config system to implement different failure levels for rules. This would allow us to make some rules like this "warning" rules while others were "failure" rules. It's a pretty significant amount of work, but something worth biting off if we consider Foodcritic to be a tool we expect to use in 3-4 more years.

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

No branches or pull requests

2 participants