mirror of
https://github.com/zama-ai/concrete.git
synced 2026-02-09 03:55:04 -05:00
chore(tools): add Makefile, formatting script, pylintrc and dependencies
refs #15
This commit is contained in:
48
script/source_format/format_python.sh
Normal file
48
script/source_format/format_python.sh
Normal file
@@ -0,0 +1,48 @@
|
||||
#!/bin/bash
|
||||
|
||||
function usage() {
|
||||
echo "$0: install system and data, to support compiler"
|
||||
echo
|
||||
echo "--help Print this message"
|
||||
echo "--check Do not apply format"
|
||||
echo "--dir Specify a source directory"
|
||||
echo
|
||||
}
|
||||
|
||||
CHECK=
|
||||
|
||||
while [ -n "$1" ]
|
||||
do
|
||||
case $1 in
|
||||
"--help" | "-h" )
|
||||
usage
|
||||
exit 0
|
||||
;;
|
||||
|
||||
"--check" )
|
||||
CHECK="$1"
|
||||
;;
|
||||
|
||||
"--dir" )
|
||||
shift
|
||||
DIRS+=("$1")
|
||||
;;
|
||||
|
||||
*)
|
||||
echo "Unknown param : $1"
|
||||
exit -1
|
||||
;;
|
||||
esac
|
||||
shift
|
||||
done
|
||||
|
||||
for SRC_DIR in "${DIRS[@]}"; do
|
||||
isort --profile black ${CHECK} ${SRC_DIR}
|
||||
((FAILURES+=$?))
|
||||
black -l 100 ${CHECK} ${SRC_DIR}
|
||||
((FAILURES+=$?))
|
||||
done
|
||||
|
||||
if [[ "$FAILURES" != "0" ]]; then
|
||||
exit 1
|
||||
fi
|
||||
Reference in New Issue
Block a user