blob: 0081293ecfa8861161a11346cc2fed328b1d5808 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
|
#!/usr/bin/env bash
file_path=$1
ext=${file_path##*.}
case $ext in
"py")
/usr/bin/black -l 88 -S -C $file_path
;;
"ipynb")
/usr/bin/black -l 88 -S -C $file_path
# jupytext $file_path --pipe "black -l 88 -S -C {}"
;;
"sh")
/usr/bin/shfmt -w $file_path
;;
"yml")
/usr/bin/prettier --print-width 88 --write $file_path
;;
"yaml")
/usr/bin/prettier --print-width 88 --write $file_path
;;
"json")
/usr/bin/prettier --print-width 88 --write $file_path
;;
*)
xte "keydown Control_L" "keydown Alt_L" "keydown Shift_L" "key O" "keyup Control_L" "keyup Alt_L" "keyup Shift_L"
;;
esac
|