1.2 KiB
| stage | group | info | title |
|---|---|---|---|
| none | unassigned | Any user with at least the Maintainer role can merge updates to this content. For details, see https://docs.gitlab.com/ee/development/development_processes.html#development-guidelines-review. | Tips and tricks |
Code deletion checklist
When your merge request deletes code, it's important to also delete all related code that is no longer used. When deleting Haml and Vue code, check whether it contains the following types of code that is unused:
-
CSS.
For example, we've deleted a Vue component that contained the
.mr-cardclass, which is now unused. The.mr-cardCSS rule set should then be deleted frommerge_requests.scss. -
Ruby variables.
Deleting unused Ruby variables is important so we don't continue instantiating them with potentially expensive code.
For example, we've deleted a Haml template that used the
@total_countRuby variable. The@total_countvariable was no longer used in the remaining templates for the page. The instantiation of@total_countinissues_controller.rbshould then be deleted so that we don't make unnecessary database calls to calculate the count of issues. -
Ruby methods.