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
5 changes: 5 additions & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
* text=auto
*.snap text eol=lf
analysis/tests*/**/expected/*.res.txt text eol=lf
analysis/tests*/**/expected/*.resi.txt text eol=lf
analysis/reanalyze/examples/**/expected/*.txt text eol=lf
4 changes: 2 additions & 2 deletions analysis/reanalyze/examples/deadcode/test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ fi
dune exec rescript-editor-analysis -- reanalyze -config -debug -ci -exclude-paths $exclude_dirs -live-names globallyLive1 -live-names globallyLive2,globallyLive3 -suppress $suppress > $output
# CI. We use LF, and the CI OCaml fork prints CRLF. Convert.
if [ "$RUNNER_OS" == "Windows" ]; then
perl -pi -e 's/\r\n/\n/g' -- $output
node ../../../scripts/normalize-lf.js "$output"
fi

output="expected/exception.txt"
Expand All @@ -21,7 +21,7 @@ fi
dune exec rescript-editor-analysis -- reanalyze -exception -ci -suppress src -unsuppress $unsuppress_dirs > $output
# CI. We use LF, and the CI OCaml fork prints CRLF. Convert.
if [ "$RUNNER_OS" == "Windows" ]; then
perl -pi -e 's/\r\n/\n/g' -- $output
node ../../../scripts/normalize-lf.js "$output"
fi


Expand Down
2 changes: 1 addition & 1 deletion analysis/reanalyze/examples/termination/test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ output="expected/termination.txt"
dune exec rescript-editor-analysis -- reanalyze -config -ci -debug > $output
# CI. We use LF, and the CI OCaml fork prints CRLF. Convert.
if [ "$RUNNER_OS" == "Windows" ]; then
perl -pi -e 's/\r\n/\n/g' -- $output
node ../../../scripts/normalize-lf.js "$output"
fi

warningYellow='\033[0;33m'
Expand Down
6 changes: 6 additions & 0 deletions analysis/scripts/normalize-lf.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
const fs = require("fs");

for (const file of process.argv.slice(2)) {
const text = fs.readFileSync(file, "utf8");
fs.writeFileSync(file, text.replace(/\r\n/g, "\n").replace(/\r/g, "\n"));
}
2 changes: 1 addition & 1 deletion analysis/tests-generic-jsx-transform/test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ for file in src/*.res; do
../../rescript-editor-analysis.exe test $file &> $output
# CI. We use LF, and the CI OCaml fork prints CRLF. Convert.
if [ "$RUNNER_OS" == "Windows" ]; then
perl -pi -e 's/\r\n/\n/g' -- $output
node ../scripts/normalize-lf.js "$output"
fi
done

Expand Down
2 changes: 1 addition & 1 deletion analysis/tests-incremental-typechecking/test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ for file in src/*.res; do
../../rescript-editor-analysis.exe test $file &> $output
# CI. We use LF, and the CI OCaml fork prints CRLF. Convert.
if [ "$RUNNER_OS" == "Windows" ]; then
perl -pi -e 's/\r\n/\n/g' -- $output
node ../scripts/normalize-lf.js "$output"
fi
done

Expand Down
45 changes: 0 additions & 45 deletions analysis/tests/src/expected/DocExtraction2.res.txt

This file was deleted.

44 changes: 0 additions & 44 deletions analysis/tests/src/expected/DocExtraction2.resi.txt

This file was deleted.

187 changes: 0 additions & 187 deletions analysis/tests/src/expected/DocExtractionRes.res.txt

This file was deleted.

4 changes: 2 additions & 2 deletions analysis/tests/test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ for file in src/*.{res,resi}; do
../../rescript-editor-analysis.exe test $file &> $output
# CI. We use LF, and the CI OCaml fork prints CRLF. Convert.
if [ "$RUNNER_OS" == "Windows" ]; then
perl -pi -e 's/\r\n/\n/g' -- $output
node ../scripts/normalize-lf.js "$output"
fi
done

Expand All @@ -12,7 +12,7 @@ for file in not_compiled/*.{res,resi}; do
../../rescript-editor-analysis.exe test $file &> $output
# CI. We use LF, and the CI OCaml fork prints CRLF. Convert.
if [ "$RUNNER_OS" == "Windows" ]; then
perl -pi -e 's/\r\n/\n/g' -- $output
node ../scripts/normalize-lf.js "$output"
fi
done

Expand Down
2 changes: 1 addition & 1 deletion tools/tests/test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ for file in src/*.{res,resi}; do
dune exec --no-print-directory -- rescript-tools doc $file > $output
# # CI. We use LF, and the CI OCaml fork prints CRLF. Convert.
if [ "$RUNNER_OS" == "Windows" ]; then
perl -pi -e 's/\r\n/\n/g' -- $output
node ../../analysis/scripts/normalize-lf.js "$output"
fi
done

Expand Down
Loading