From 4c0b3429f0ef80ecfa2f664626572053341fbbab Mon Sep 17 00:00:00 2001 From: Claude Date: Thu, 13 Nov 2025 20:07:57 +0000 Subject: [PATCH] Add .gitattributes to enforce LF line endings for shell scripts This fixes issues when running scripts in WSL where CRLF line endings cause 'No such file or directory' errors. Also add a fix_line_endings.sh script for users who already have the wrong line endings. --- .gitattributes | 2 ++ scripts/fix_line_endings.sh | 18 ++++++++++++++++++ 2 files changed, 20 insertions(+) create mode 100644 .gitattributes create mode 100755 scripts/fix_line_endings.sh diff --git a/.gitattributes b/.gitattributes new file mode 100644 index 0000000..7c75d96 --- /dev/null +++ b/.gitattributes @@ -0,0 +1,2 @@ +# Ensure shell scripts always use LF line endings +*.sh text eol=lf diff --git a/scripts/fix_line_endings.sh b/scripts/fix_line_endings.sh new file mode 100755 index 0000000..d2af20f --- /dev/null +++ b/scripts/fix_line_endings.sh @@ -0,0 +1,18 @@ +#!/bin/bash +# Fix line endings for coverage scripts + +echo "Fixing line endings for coverage scripts..." + +# Convert CRLF to LF +dos2unix scripts/measure_coverage.sh 2>/dev/null || sed -i 's/\r$//' scripts/measure_coverage.sh +dos2unix scripts/generate_coverage_html.sh 2>/dev/null || sed -i 's/\r$//' scripts/generate_coverage_html.sh + +# Ensure execute permissions +chmod +x scripts/measure_coverage.sh +chmod +x scripts/generate_coverage_html.sh + +echo "Done! Line endings fixed and execute permissions set." +echo "" +echo "You can now run:" +echo " make coverage-report" +echo " make coverage-html"