File: format-ocaml.sh

package info (click to toggle)
js-of-ocaml 2.5-2
  • links: PTS, VCS
  • area: main
  • in suites: stretch
  • size: 4,816 kB
  • ctags: 7,597
  • sloc: ml: 40,337; makefile: 731; lisp: 41; sh: 14; ruby: 4; perl: 4
file content (12 lines) | stat: -rwxr-xr-x 436 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
#!/bin/bash

echo "# Removing tabs"
find ./ -regex "^\.\(/[a-zA-Z0-9_-.]*\)*\.ml[il]?" -exec sed -i 's/	//g' {} \;

echo "# Whitespace"
SCRIPT=$(readlink -f $0)
SCRIPTPATH=`dirname $SCRIPT`
find ./ -regex "^\.\(/[a-zA-Z0-9_-.]*\)*\.ml[il]?" -exec emacs -batch {} -l ${SCRIPTPATH}/emacs-format-ocaml.el -f emacs-format-function-clean \;

echo "# Indent files"
find ./ -regex "^\.\(/[a-zA-Z0-9_-.]*\)*\.ml[il]?" -exec ocp-indent -i {} \;