Skip to content

Add Tailwind CSS Dangerfile

Paul Gascou-Vaillancourt requested to merge danger-tailwindcss into master

What does this MR do and why?

Add Tailwind CSS Dangerfile

This adds a new Dangerfile to do some Tailwind-related reporting. Currently, we check whether the diff potentially contains interpolated CSS utils. We might extend this rule to report additional info about CSS utils usages.

We're adding this to prevent CSS utilities from being built dynamically via string interpolation as that would prevent Tailwind from generating them.

MR acceptance checklist

Please evaluate this MR against the MR acceptance checklist. It helps you analyze changes to reduce risks in quality, performance, reliability, security, and maintainability.

Screenshots or screen recordings

Screenshot_2024-04-10_at_5.55.05_PM

How to set up and validate locally

  1. Insert some text within a file that would be detected as a potential interpolated utils:
    • In a Vue or Js file, add something like gl-test-${.
    • In a HAML or Ruby file, add something like gl-test-#{.
  2. Commit the changes.
  3. Run Danger: bin/rake danger_local.
    • You should see a warning about the files you've added the pattern to.

Re #443664 (closed)

Edited by Paul Gascou-Vaillancourt

Merge request reports