Skip to content

Commit

Permalink
Update format script
Browse files Browse the repository at this point in the history
  • Loading branch information
takos22 committed May 23, 2021
1 parent ae40d42 commit 44343e4
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions scripts/format.sh
Original file line number Diff line number Diff line change
@@ -1,14 +1,17 @@
#!/bin/sh
set -e

folders="baguette tests examples"

set -x

# put every import on one line for autoflake remove unused imports
isort baguette tests examples --force-single-line-imports
isort $folders --force-single-line-imports
# remove unused imports and variables
autoflake baguette tests examples --remove-all-unused-imports --recursive --remove-unused-variables --in-place --exclude=__init__.py
autoflake $folders --remove-all-unused-imports --recursive --remove-unused-variables --in-place --exclude=__init__.py

# format code
black baguette tests examples --line-length 80
black $folders --line-length 80

# resort imports
isort baguette tests examples
isort $folders

0 comments on commit 44343e4

Please sign in to comment.