Skip to content

Add rule for table without any CSS class

Thomas Hutterer requested to merge add_rule_for_table_without_any_class into main

This adds an extra rule for our table semgreps, checking Haml for lines with only %table in them, so table tags without any classes (or anything else). This currently yields 9 results and the ones I manually checked all are correct results. We should make those tables into %table.gl-table.

I considered making the rule more sophisticated (aka more complicated regexp), like checking for %table#some-id-but-not-following-by-period-or-hash-notation-with-class:-in-it but after some manual searching in our codebase, I didn't spot anything like that, so I decided to keep the regexp super simple for now.

We already have a similar rule (table-tag-vue) for our Vue/JS, so no change required there.

Merge request reports