File tree Expand file tree Collapse file tree 4 files changed +26
-14
lines changed Expand file tree Collapse file tree 4 files changed +26
-14
lines changed Original file line number Diff line number Diff line change @@ -75,7 +75,7 @@ format:
75
75
dune build @fmt --auto-promote
76
76
77
77
checkformat :
78
- dune build @fmt
78
+ node scripts/check_format.sh
79
79
80
80
clean-gentype :
81
81
make -C jscomp/gentype_tests/typescript-react-example clean
Original file line number Diff line number Diff line change
1
+ #! /bin/bash
2
+
3
+ warningYellow=' \033[0;33m'
4
+ successGreen=' \033[0;32m'
5
+ reset=' \033[0m'
6
+
7
+ case " $( uname -s) " in
8
+ Darwin|Linux)
9
+ echo " Checking code formatting..."
10
+ if opam exec -- dune build @fmt; then
11
+ printf " ${successGreen} ✅ OCaml code formatting ok.${reset} \n"
12
+ else
13
+ printf " ${warningYellow} ⚠️ OCaml code formatting issues found.${reset} \n"
14
+ exit 1
15
+ fi
16
+ ;;
17
+ * )
18
+ # Does not work on Windows
19
+ echo " OCaml code formatting check skipped for this platform."
20
+ esac
Original file line number Diff line number Diff line change @@ -90,6 +90,11 @@ async function runTests() {
90
90
cwd : path . join ( __dirname , ".." ) ,
91
91
stdio : [ 0 , 1 , 2 ] ,
92
92
} ) ;
93
+
94
+ cp . execSync ( "bash scripts/check_format.sh" , {
95
+ cwd : path . join ( __dirname , ".." ) ,
96
+ stdio : [ 0 , 1 , 2 ] ,
97
+ } ) ;
93
98
}
94
99
}
95
100
Original file line number Diff line number Diff line change 115
115
116
116
rm -r temp/
117
117
popd
118
-
119
- # Check format (does not work on Windows)
120
- case " $( uname -s) " in
121
- Darwin|Linux)
122
- echo " Checking code formatting..."
123
- if opam exec -- dune build @fmt; then
124
- printf " ${successGreen} ✅ Code formatting ok.${reset} \n"
125
- else
126
- printf " ${warningYellow} ⚠️ Code formatting failed.${reset} \n"
127
- exit 1
128
- fi
129
- ;;
130
- esac
You can’t perform that action at this time.
0 commit comments