Skip to content

Add a test for deprecated utility classes

Sarah German requested to merge deprecated-utility-classes-finder into main

What does this MR do and why?

Adds a test to check for deprecated CSS utility classes. As we've copied templates and components over from Nanoc, we've missed a few of these. These classes need to be adjusted in order to work with Tailwind.

This is a simplified version of this script: gitlab-org/gitlab!156051 (merged)

Screenshots, screen recordings, or links to review app

How to set up and validate locally

Numbered steps to set up and validate the change are strongly suggested.

  1. Configure a local GitLab Docs environment: https://gitlab.com/gitlab-org/technical-writing-group/gitlab-docs-hugo/-/blob/main/doc/setup.md.
  2. Check out this branch
  3. Run make lint-frontend, which now includes this test. It should not find any deprecated classes.
  4. Revert the commit in this MR that fixed the found classes: git revert afd52f50
  5. Run the test again: make lint-frontend. It should show found deprecated classes
  6. Run the script directly with the --fix flag (./scripts/frontend/find_deprecated_classes.js --fix) and check the git diff. Templates should have the suggested replacements applied by the script.

Merge request acceptance checklist

This checklist encourages us to confirm any changes have been analyzed to reduce risks in quality, performance, reliability, security, and maintainability.

Edited by Sarah German

Merge request reports