File tree Expand file tree Collapse file tree 1 file changed +20
-2
lines changed
Expand file tree Collapse file tree 1 file changed +20
-2
lines changed Original file line number Diff line number Diff line change @@ -8,14 +8,32 @@ format_issues=$?
88
99failed=0
1010
11+ # Check for the presence of the "!!!" or "???" markers in the files
12+ # the consecutive non-empty line must begin with 4 spaces
1113while read -r file; do
1214 awk -v fname=" $file " '
1315 /^(!!!|\?\?\?)/ {
1416 current_line_number = NR
1517 current_line = $0
16- if (getline nextLine <= 0 || nextLine !~ /^ /) {
18+ found_next_content = 0
19+ while (getline nextLine > 0) {
20+ # Skip empty lines
21+ if (nextLine ~ /^$/) {
22+ continue
23+ }
24+ found_next_content = 1
25+ if (nextLine !~ /^ /) {
26+ print "File:", fname
27+ print "Error in Line ", current_line_number, "Expected next non-empty line to start with 4 spaces"
28+ print ">>", current_line
29+ print "------"
30+ exit 1
31+ }
32+ break
33+ }
34+ if (!found_next_content) {
1735 print "File:", fname
18- print "Error in Line ", current_line_number, "Expected next line to start with 4 spaces "
36+ print "Error in Line ", current_line_number, "Found marker but no content following it "
1937 print ">>", current_line
2038 print "------"
2139 exit 1
You can’t perform that action at this time.
0 commit comments