blob: dcacdb8387b726b825524f9bda1493d33fd92ee7 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
|
---
stage: none
group: unassigned
info: To determine the technical writer assigned to the Stage/Group associated with this page, see https://about.gitlab.com/handbook/product/ux/technical-writing/#assignments
---
# 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-card` class, which is now unused.
The `.mr-card` CSS rule set should then be deleted from `merge_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_count` Ruby variable.
The `@total_count` variable was no longer used in the remaining templates for the page.
The instantiation of `@total_count` in `issues_controller.rb` should then be deleted so that we
don't make unnecessary database calls to calculate the count of issues.
- Ruby methods.
|