File tree 3 files changed +10
-7
lines changed 3 files changed +10
-7
lines changed Original file line number Diff line number Diff line change 1
1
# ignore everything except files with selected extensions
2
+ # Keep in sync with bin/git_hooks/check_format.sh
2
3
*
3
4
! /** /
4
5
! * . *
Original file line number Diff line number Diff line change @@ -95,23 +95,23 @@ clean-all: clean
95
95
find . -type d -name ' node_modules' -prune -print0 | xargs -0 rm -rf
96
96
97
97
.PHONY : fmt-sk
98
- fmt-sk :
98
+ fmt-sk : # Keep in sync with bin/git_hooks/check_format.sh
99
99
find . -path ./skiplang/compiler/tests -not -prune -or -name \* .sk | parallel skfmt -i {}
100
100
101
101
.PHONY : fmt-c
102
- fmt-c :
103
- find . -path ./node_modules -not -prune -or -path ./skiplang/prelude/libbacktrace -not -prune -or -path ./sql/test/TPC-h/tnt-tpch -not -prune -or -regex ' .*\.[ch] \(c\|pp\)* ' | parallel clang-format -i {}
102
+ fmt-c : # Keep in sync with bin/git_hooks/check_format.sh
103
+ find . -path ./node_modules -not -prune -or -path ./skiplang/prelude/libbacktrace -not -prune -or -path ./sql/test/TPC-h/tnt-tpch -not -prune -or -regex ' .*\.\(c\|cc\|cpp\|h\|hh\|hpp\) ' | parallel clang-format -i {}
104
104
105
105
.PHONY : fmt-js
106
- fmt-js :
106
+ fmt-js : # Keep in sync with bin/git_hooks/check_format.sh
107
107
npx prettier --log-level warn --write .
108
108
109
109
.PHONY : fmt-py
110
- fmt-py :
110
+ fmt-py : # Keep in sync with bin/git_hooks/check_format.sh
111
111
black --quiet --line-length 80 .
112
112
113
113
.PHONY : fmt
114
- fmt : fmt-sk fmt-c fmt-js fmt-py
114
+ fmt : fmt-sk fmt-c fmt-js fmt-py # Keep in sync with bin/git_hooks/check_format.sh
115
115
116
116
.PHONY : check-fmt
117
117
check-fmt : fmt
Original file line number Diff line number Diff line change @@ -10,10 +10,12 @@ check-file () {
10
10
# select formatter based on filename extension, must transform stdin to stdout
11
11
if [[ " $file " == * .sk ]]; then # keep in sync with fmt-sk in Makefile
12
12
fmt=" skfmt --assume-filename=$file "
13
- elif [[ " $file " =~ .* \. [ch](pp) ? $ ]]; then # keep in sync with fmt-c in Makefile
13
+ elif [[ " $file " =~ .* \. (c | cc | cpp | h | hh | hpp) $ ]]; then # keep in sync with fmt-c in Makefile
14
14
fmt=" clang-format --assume-filename=$file "
15
15
elif [[ " $file " =~ .* \. (css| html| js| json| mjs| ts| tsx)$ ]]; then # keep in sync with .prettierignore
16
16
fmt=" npx prettier --stdin-filepath $file "
17
+ elif [[ " $file " == * .py ]]; then # keep in sync with fmt-py in Makefile
18
+ fmt=" black - --quiet --line-length 80 --stdin-filename $file "
17
19
else
18
20
exit 0;
19
21
fi
You can’t perform that action at this time.
0 commit comments