feat: Add basic rules for broadcast message
This adds basic rules for broadcast messages.
When run against gitlab-org/gitlab@73269ed6, it correctly finds exactly one file with 7 violations:
$ semgrep --config rules/components/broadcast_message/ ~/dev/gdk-ee/gitlab/{ee/,}app
Scanning 7350 files with 4 <multilang> rules.
[...snip...]
Findings:
/home/markrian/dev/gdk-ee/gitlab/app/views/shared/_broadcast_message.html.haml
rules.components.broadcast_message.broadcast-message-class-haml
Detected usage of broadcast message class(es). Please use the Pajamas::BroadcastMessage
ViewComponent instead.
6┆ .gl-broadcast-message.broadcast-banner-message{ role: "alert", class: "js-broadcast-notification-#{message.id} #{message.theme}" }
⋮┆----------------------------------------
6┆ .gl-broadcast-message.broadcast-banner-message{ role: "alert", class: "js-broadcast-notification-#{message.id} #{message.theme}" }
⋮┆----------------------------------------
7┆ .gl-broadcast-message-content
⋮┆----------------------------------------
8┆ .gl-broadcast-message-icon
⋮┆----------------------------------------
10┆ .gl-broadcast-message-text.js-broadcast-message-preview
⋮┆----------------------------------------
24┆ .broadcast-message.broadcast-notification-message.mt-2{ role: "alert", class: notification_class }
⋮┆----------------------------------------
24┆ .broadcast-message.broadcast-notification-message.mt-2{ role: "alert", class: notification_class }
[...snip...]
Ran 4 rules on 7350 files: 7 findings.
Addresses #7 (closed).
Edited by Mark Florian