-
Notifications
You must be signed in to change notification settings - Fork 32
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
3 changed files
with
24 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -42,5 +42,8 @@ release: | |
format: | ||
python3 scripts/format.py | ||
|
||
format-check: | ||
python3 scripts/format.py --check | ||
|
||
clean: | ||
rm -rf build |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,17 @@ | ||
from subprocess import check_call | ||
from os import scandir | ||
from glob import glob | ||
from argparse import ArgumentParser | ||
|
||
parser = ArgumentParser() | ||
parser.add_argument('--check', action='store_true') | ||
args = parser.parse_args() | ||
|
||
template = ['clang-format', '-i'] | ||
if args.check: | ||
template += ['--dry-run', '--Werror'] | ||
|
||
for name in ['src/jni/duckdb_java.cpp'] + glob('src/**/*.java', recursive=True): | ||
print('Formatting', name) | ||
check_call(['clang-format', '-i', name]) | ||
check_call(template + [name]) | ||
|