@@ -15,7 +15,7 @@ Examples where `auto` is appropriate:
15
15
16
16
// Lambdas have unreadable and compiler-generated types — use auto for them
17
17
auto add = [](int x, int y) { return x + y; };
18
-
18
+
19
19
20
20
Avoid `auto ` when the type is simple and clear:
21
21
@@ -44,3 +44,53 @@ Avoid:
44
44
}
45
45
46
46
Rationale: clear, explicit types help with readability and understanding. Avoid hiding simple types behind `auto `.
47
+
48
+
49
+ Commenting Style
50
+ ================
51
+ Comment types and rules:
52
+
53
+ - Use `/* ... */ ` **only ** for Doxygen documentation comments.
54
+ Do **not ** use block comments (`/* */ `) to describe code logic or individual lines in function bodies.
55
+
56
+ - Use `// ` for all regular comments within function bodies or implementation code.
57
+
58
+ Formatting rules for `// ` comments:
59
+
60
+ - Always include a space between `// ` and the comment text.
61
+ - Use full sentences when appropriate.
62
+ - For multi-line comments, prefix each line with `// `.
63
+
64
+ Examples (correct usage):
65
+
66
+ .. code-block :: cpp
67
+
68
+ // Check if the node has already been visited
69
+ if (visited[node_id]) {
70
+ return;
71
+ }
72
+
73
+ // Enable debug output for route estimation
74
+ bool debug_enabled = true;
75
+
76
+ /**
77
+ * @brief Estimates the wirelength of a net using bounding box.
78
+ *
79
+ * @param net_id ID of the net to analyze.
80
+ * @return Estimated wirelength in units.
81
+ */
82
+ float estimate_wirelength(ClusterNetId net_id);
83
+
84
+ Incorrect usage:
85
+
86
+ .. code-block :: cpp
87
+
88
+ /* Check if visited */ // Block comments are not allowed here
89
+ if (visited[node_id]) {
90
+ return;
91
+ }
92
+
93
+ //Missing space
94
+ //inconsistent formatting
95
+
96
+ /* Non-Doxygen block comment */ // Not permitted
0 commit comments