@@ -1095,23 +1095,15 @@ jobs:
1095
1095
fi
1096
1096
expected_count="$first_line"
1097
1097
1098
- # Verify the last line is completely empty (no spaces).
1099
- last_line=$(tail -n 1 "$FILE")
1100
- if [ -n "$last_line" ]; then
1101
- echo "Error: The last line of $FILE must be empty (without spaces)."
1102
- exit 1
1103
- fi
1104
-
1105
- # Check that the number of lines between the first and last matches the integer.
1106
- # xargs (with no arguments) will strip leading/trailing whitespace from wc's output.
1107
- actual_count=$(sed '1d;$d' "$FILE" | wc -l | xargs)
1098
+ # Check that the number of lines matches the integer.
1099
+ # xargs (with no arguments) will strip leading/trailing whitespacefrom wc's output.
1100
+ actual_count=$(sed '1d' "$FILE" | wc -l | xargs)
1108
1101
if [ "$expected_count" -ne "$actual_count" ]; then
1109
- echo "Error: The number of lines between the first and last ($actual_count) does not match $expected_count."
1102
+ echo "Error: The number of lines ($actual_count) does not match $expected_count."
1110
1103
exit 1
1111
1104
fi
1112
1105
1113
- # `sed` removes the first line (number of words) and
1114
- # the last line (new line).
1106
+ # `sed` removes the first line (number of words).
1115
1107
#
1116
1108
# `sort` makes sure everything in between is sorted
1117
1109
# and contains no duplicates.
@@ -1121,10 +1113,10 @@ jobs:
1121
1113
# environments.
1122
1114
1123
1115
(
1124
- sed '1d; $d ' $FILE | LC_ALL=en_US.UTF8 sort -uc
1116
+ sed '1d' $FILE | LC_ALL=en_US.UTF8 sort -uc
1125
1117
) || {
1126
1118
echo "Dictionary is not in sorted order. Correct order is:"
1127
- LC_ALL=en_US.UTF8 sort -u <(sed '1d; $d ' $FILE)
1119
+ LC_ALL=en_US.UTF8 sort -u <(sed '1d' $FILE)
1128
1120
false
1129
1121
}
1130
1122
- name : Run cargo-spellcheck
0 commit comments