Skip to content

Commit efeba4c

Browse files
authored
👻 Hack: consistent indentation in codeSnip (#414)
For parsing in the UI, we're assuming there are exactly 2 spaces between the line numbers and the code, and that the line numbers are right-aligned before these 2 spaces (possible leading whitespace). To test the corner cases of the parser, this fixes the indentation in the mock codeSnip and changes the line numbers so the snip contains the boundary between line 99 and line 100 (leading whitespace change). Signed-off-by: Mike Turley <[email protected]>
1 parent 8f04771 commit efeba4c

File tree

1 file changed

+23
-23
lines changed

1 file changed

+23
-23
lines changed

Diff for: hack/add/analysis.sh

+23-23
Original file line numberDiff line numberDiff line change
@@ -105,31 +105,31 @@ echo -n "- file: /thing.com/file/${i}${f}.java
105105
facts:
106106
factA: ${i}-${n}.A
107107
factB: ${i}-${n}.B
108-
line: 459
108+
line: 106
109109
" >> ${file}
110110
if ((${n} < 6)); then echo -n " codesnip: |2
111-
450 public class SwapNumbers {
112-
451 public static void main(String[] args) {
113-
452 float first = 1.20f, second = 2.45f;
114-
453
115-
454 System.out.println(\"--Before swap--\");
116-
455 System.out.println(\"First number = \" + first);
117-
456 System.out.println(\"Second number = \" + second);
118-
457
119-
458 // Value of first is assigned to temporary
120-
459 float temporary = first;
121-
460
122-
461 // Value of second is assigned to first
123-
462 first = second;
124-
463
125-
464 // Value of temporary assigned to second
126-
465 second = temporary;
127-
466
128-
467 System.out.println(\"--After swap--\");
129-
468 System.out.println(\"First number = \" + first);
130-
469 System.out.println(\"Second number = \" + second);
131-
470 }
132-
471 }
111+
97 public class SwapNumbers {
112+
98 public static void main(String[] args) {
113+
99 float first = 1.20f, second = 2.45f;
114+
100
115+
101 System.out.println(\"--Before swap--\");
116+
102 System.out.println(\"First number = \" + first);
117+
103 System.out.println(\"Second number = \" + second);
118+
104
119+
105 // Value of first is assigned to temporary
120+
106 float temporary = first;
121+
107
122+
108 // Value of second is assigned to first
123+
109 first = second;
124+
110
125+
111 // Value of temporary assigned to second
126+
112 second = temporary;
127+
113
128+
114 System.out.println(\"--After swap--\");
129+
115 System.out.println(\"First number = \" + first);
130+
116 System.out.println(\"Second number = \" + second);
131+
117 }
132+
118 }
133133
" >> ${file}
134134
fi
135135
done

0 commit comments

Comments
 (0)