-
Notifications
You must be signed in to change notification settings - Fork 1
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
Zikang Xiong
committed
Mar 7, 2024
1 parent
266986f
commit d84b3c0
Showing
7 changed files
with
162 additions
and
115 deletions.
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 |
---|---|---|
@@ -0,0 +1,33 @@ | ||
#!/bin/bash | ||
|
||
# Default source directory and options for the tools | ||
SOURCE_DIR="." | ||
AUTOFIX_OPTIONS="--remove-all-unused-imports --remove-unused-variables --expand-star-imports --ignore-init-module-imports --in-place -r" | ||
ISORT_OPTIONS="--profile black --line-length 88" | ||
BLACK_OPTIONS="--line-length 88" | ||
|
||
|
||
# Install the necessary packages | ||
pip install autoflake isort black | ||
|
||
# Run autoflake with the specified options | ||
output=$(autoflake $SOURCE_DIR $AUTOFIX_OPTIONS) | ||
if [ -n "$output" ]; then | ||
echo "Autoflake made changes or found issues:" | ||
echo "$output" | ||
# Uncomment the next line if you want the script to fail on changes | ||
# exit 1 | ||
else | ||
echo "No issues found by autoflake." | ||
fi | ||
|
||
# Run isort with the specified options | ||
echo "Running isort..." | ||
isort $SOURCE_DIR $ISORT_OPTIONS | ||
|
||
# Run black with the specified options | ||
echo "Running black..." | ||
black $SOURCE_DIR $BLACK_OPTIONS | ||
|
||
# Final message | ||
echo "Linting complete." |
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
Oops, something went wrong.