Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 16 additions & 0 deletions scripts/verify-docs.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
# produced by the currently installed cowel for every source file whose
# version comment matches the installed version.
# Also rejects trailing whitespace and literal tab characters in all .cow files.
# Also rejects CRLF line terminators and missing final newlines in all src/ files.
#
# Usage: scripts/verify-docs.sh
# Run from the repository root.
Expand All @@ -12,6 +13,21 @@ set -e
version=$(cowel --version)
failed=0

# Check all src/ files for CRLF line terminators and missing final newline.
while IFS= read -r src; do
if grep -Pq $'\r' "$src" 2>/dev/null; then
echo "CRLF: $src contains CRLF line terminators"
failed=1
fi
if [ -s "$src" ]; then
last=$(tail -c 1 "$src" | od -An -tx1 | tr -d ' \n')
if [ "$last" != "0a" ]; then
echo "NO_FINAL_NL: $src does not end with a newline"
failed=1
fi
fi
done < <(find src/ -type f)

# Check all .cow sources for trailing whitespace and tab characters.
while IFS= read -r src; do
if grep -Pq '\t' "$src"; then
Expand Down
2 changes: 1 addition & 1 deletion src/array-layout.bs
Original file line number Diff line number Diff line change
Expand Up @@ -250,4 +250,4 @@ W.I.P.
<pre class=biblio>
{
}
</pre>
</pre>
2 changes: 1 addition & 1 deletion src/bitint-lewg-slides.cow
Original file line number Diff line number Diff line change
Expand Up @@ -137,4 +137,4 @@ integral types
\li{\em{very surprising} if \tcode{std::is_integral_v<_BitInt(N)>} was \tcode{false}}
\li{huge wording/teaching effort to treat \tcode{_BitInt(N)} specially}
}
}
}
2 changes: 1 addition & 1 deletion src/constexpr-to-string.bs
Original file line number Diff line number Diff line change
Expand Up @@ -293,4 +293,4 @@ Update subclause 23.4.5 [string.conversions] as follows:
"href": "https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2022/p2587r3.html#biblio-codesearch"
}
}
</pre>
</pre>
12 changes: 6 additions & 6 deletions src/icon/css.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
90 changes: 45 additions & 45 deletions src/icon/go.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
8 changes: 4 additions & 4 deletions src/icon/javascript.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion src/icon/julia.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Loading