diff options
Diffstat (limited to 'black_pycharm_formatter.sh')
-rwxr-xr-x | black_pycharm_formatter.sh | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/black_pycharm_formatter.sh b/black_pycharm_formatter.sh index 02c22f1816c2..175bef8a1fca 100755 --- a/black_pycharm_formatter.sh +++ b/black_pycharm_formatter.sh @@ -1,13 +1,15 @@ #!/usr/bin/env bash -case $2 in +file_path=$1 +ext=${file_path##*.} +case $ext in "py") - black -l 80 -S $1 + black -l 80 -S $file_path ;; "ipynb") - jupytext $1 --pipe "black -l 80 -S {}" + jupytext $file_path --pipe "black -l 80 -S {}" ;; "sh") - shfmt -w $1 + shfmt -w $file_path ;; esac |