-
Notifications
You must be signed in to change notification settings - Fork 9
Raise default remediation, categorize checks #19
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Categorize checks loosely based on the CSSLint wiki[1]. The most obvious departure was categorizing Performance rules as Bug Risk checks. 1: https://github.com/CSSLint/csslint/wiki/Rules Default remediation was at an abysmal 500, upped it to the "trivial" baseline for now and built a small class allowing us to easily override these later. I chose keyword arguments in the CheckDetails class so we can easily create an override object for one, the other, or both of categories and remediation points.
0b5b203
to
9da9360
Compare
Ignoring CC issues.
|
|
||
def self.all | ||
@all ||= { | ||
"net.csslint.Adjoiningclasses" => new(categories: "Compatability"), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
should these go in a constant? Maybe of the format
"net.csslint.Adjoiningclasses" => { categories: "Compatability", }
and then in fetch below you can do
new(all.fetch(check_name, {}))
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, great suggestion.
LGTM |
module Engine | ||
class CSSlint | ||
# https://github.com/CSSLint/csslint/wiki/Rules | ||
class CheckDetails |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It seems like the major function of this class at present is to get the category for an issue.
What do you think about having a category
class instead, and have it initialize with a check?
Then, in the CSSLint
or an Issue
class, we can have
def categories
Category.new(check_name)
end
def remediation_points
DEFAULT_REMEDIATION_POINTS
end
Raise default remediation, categorize checks
Default remediation was at an abysmal 500, upped it to the "trivial" baseline
for now and built a small class allowing us to easily override later.
Categorized checks loosely based on the CSSLint wiki[1]. The most obvious
departure was categorizing Performance rules as Bug Risk checks.
I chose keyword arguments in CheckDetails so we can easily create an override
object for one, the other, or both of categories and remediation points.
1: https://github.com/CSSLint/csslint/wiki/Rules
/cc @codeclimate/review