Reduce duplicate button findings
Ignore button component files in class rule
It doesn't make sense to look for "private" classes in the component that implements the design system.
This removes a single finding: https://gitlab.com/gitlab-org/gitlab/-/blob/aab3d381da92892252a2fb85794e403e0022a5c6/app/components/pajamas/button_component.rb#L57
Ignore gl-button-* modifier classes
These will usually be accompanied by the gl-button
class itself. This
means we were over counting the number of non-compliant buttons.
Use of the gl-button-icon
class is a code smell. In this case, it's
used for rendering a custom image rather than a standard SVG icon, which
the Pajamas::ButtonComponent
does not support.
This results in 28 fewer findings against gitlab-org/gitlab@aab3d381. These findings can be seen before this change with this filter:
check_id ew "button-class-haml-rb" and extra.lines co "gl-button-"
Addresses #76 (closed) and gitlab-org/gitlab#417792 (comment 1467315342).
Screenshots
Before | After |
---|---|
Review/run this locally
- Copy the
pages in mr
job URL (must have succeeded) - Run
bin/review-mr.sh <job url>