diff --git a/scripts/verify-docs.sh b/scripts/verify-docs.sh index 3272877..dc69559 100755 --- a/scripts/verify-docs.sh +++ b/scripts/verify-docs.sh @@ -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. @@ -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 diff --git a/src/array-layout.bs b/src/array-layout.bs index ba3e472..64ed395 100644 --- a/src/array-layout.bs +++ b/src/array-layout.bs @@ -250,4 +250,4 @@ W.I.P.
{
}
-
\ No newline at end of file
+
diff --git a/src/bitint-lewg-slides.cow b/src/bitint-lewg-slides.cow
index 9cf56ff..a1f7af4 100644
--- a/src/bitint-lewg-slides.cow
+++ b/src/bitint-lewg-slides.cow
@@ -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}
}
-}
\ No newline at end of file
+}
diff --git a/src/constexpr-to-string.bs b/src/constexpr-to-string.bs
index b22cc65..fa686f2 100644
--- a/src/constexpr-to-string.bs
+++ b/src/constexpr-to-string.bs
@@ -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"
}
}
-
\ No newline at end of file
+
diff --git a/src/icon/css.svg b/src/icon/css.svg
index ce5eb76..0bbea83 100644
--- a/src/icon/css.svg
+++ b/src/icon/css.svg
@@ -1,6 +1,6 @@
-
\ No newline at end of file
+
diff --git a/src/icon/go.svg b/src/icon/go.svg
index 5625a85..2c927f8 100644
--- a/src/icon/go.svg
+++ b/src/icon/go.svg
@@ -1,45 +1,45 @@
-
+
diff --git a/src/icon/javascript.svg b/src/icon/javascript.svg
index d19a6a5..9623cd9 100644
--- a/src/icon/javascript.svg
+++ b/src/icon/javascript.svg
@@ -1,4 +1,4 @@
-
\ No newline at end of file
+
diff --git a/src/icon/julia.svg b/src/icon/julia.svg
index 3dd6834..f4e389f 100644
--- a/src/icon/julia.svg
+++ b/src/icon/julia.svg
@@ -1 +1 @@
-
+
diff --git a/src/icon/kotlin.svg b/src/icon/kotlin.svg
index a53eafe..e64e054 100644
--- a/src/icon/kotlin.svg
+++ b/src/icon/kotlin.svg
@@ -1,31 +1,31 @@
-
+
diff --git a/src/icon/python.svg b/src/icon/python.svg
index 70ddc10..38ea8ad 100644
--- a/src/icon/python.svg
+++ b/src/icon/python.svg
@@ -1 +1 @@
-
+
diff --git a/src/icon/rust.svg b/src/icon/rust.svg
index 8ecd86f..28dd179 100644
--- a/src/icon/rust.svg
+++ b/src/icon/rust.svg
@@ -1 +1 @@
-
+
diff --git a/src/icon/swift.svg b/src/icon/swift.svg
index 2148060..382b9e6 100644
--- a/src/icon/swift.svg
+++ b/src/icon/swift.svg
@@ -1 +1 @@
-
\ No newline at end of file
+
diff --git a/src/icon/typescript.svg b/src/icon/typescript.svg
index a98ddea..520f042 100644
--- a/src/icon/typescript.svg
+++ b/src/icon/typescript.svg
@@ -1,4 +1,4 @@
-
\ No newline at end of file
+
diff --git a/src/modular-arithmetic.bs b/src/modular-arithmetic.bs
index 4d3e9e4..c6d1313 100644
--- a/src/modular-arithmetic.bs
+++ b/src/modular-arithmetic.bs
@@ -243,4 +243,4 @@ Note: The name of the subclause is based on [meta.trans.sign], sign modification
{
}
-
\ No newline at end of file
+