You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: exercises/concept/logs-logs-logs/.meta/design.md
+15-2Lines changed: 15 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -26,9 +26,22 @@ This exercise's prerequisites Concepts are:
26
26
This exercise could benefit from the following rules in the [analyzer][analyzer]:
27
27
28
28
1. Parse log level
29
-
-`essential`: Verify that a switch statement was used. If they used if-else, comment that switch is better due to their being many cases.
29
+
-`LogLevel`
30
+
-`essential`: Verify that necessary and sufficient constants are present in enum declaration (minus unknown, for now) and that the constructor is present.
31
+
-`actionable`: The enum should be public; prompt the student to think of encapsulation.
32
+
-`LogLine.getLogLevel()`
33
+
-`essential`: Verify that a switch statement was used. If they used if-else, comment that switch is better due to there being many cases.
34
+
-`actionable`: The function should be public.
30
35
2. Support unknown log level
31
-
-`essential`: Again, verify that a default was used in a switch statement. Comment as above in the case of an if-else.
36
+
-`essential`: Verify that an unknown constant is present in the enum declaration.
37
+
-`essential`: Verify that a default was used in a switch statement. Comment as previously stated in the case of an if-else.
32
38
3. Convert log line to short format
39
+
-`essential`: Verify that the constructor is appropriately updated.
40
+
-`essential`: Verify that there exists a field dedicated to the encoded log level.
41
+
-`actionable`: Said field should be private and final.
42
+
-`LogLine.getOutputForShortLog()`
43
+
-`celebratory`: Congratulate the student if they used a getter for the encoded log level.
44
+
-`celebratory`: Celebrate if this was written in one line.
45
+
-`informative`: Let them know they can write it in one line.
0 commit comments