Add a test for deprecated utility classes
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
- Test fails the pipeline if deprecated classes are found: https://gitlab.com/gitlab-org/technical-writing-group/gitlab-docs-hugo/-/jobs/7321249560
- Test passes after we fixed the classes: https://gitlab.com/gitlab-org/technical-writing-group/gitlab-docs-hugo/-/jobs/7321634922#L80
How to set up and validate locally
Numbered steps to set up and validate the change are strongly suggested.
-
Configure a local GitLab Docs environment: https://gitlab.com/gitlab-org/technical-writing-group/gitlab-docs-hugo/-/blob/main/doc/setup.md. -
Check out this branch -
Run make lint-frontend
, which now includes this test. It should not find any deprecated classes. -
Revert the commit in this MR that fixed the found classes: git revert afd52f50
-
Run the test again: make lint-frontend
. It should show found deprecated classes -
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.
-
I have evaluated the MR acceptance checklist for this merge request.
Edited by Sarah German