Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Tool name and command standardization #10

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 4 additions & 5 deletions check-import-order
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
#!/bin/sh -e

TOOL_CMD=isort
PATH=$(basename $0)/utils:$PATH
TOOL_PATH=$(which $TOOL_CMD)
TOOL_NAME=isort
TOOL_CMD="python3 -m $TOOL_NAME"

echo "** Running $TOOL_CMD ($TOOL_PATH)..."
$TOOL_PATH --check-only --profile black .
echo "** Running $TOOL_NAME..."
$TOOL_CMD --check-only --profile black .
15 changes: 8 additions & 7 deletions check-lint
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
#!/bin/sh -e

TOOL_CMD=pylint
TOOL_NAME=pylint
TOOL_CMD="python3 -m $TOOL_NAME"
BASE_DIR=$(dirname "$0")
CONFIG_FILE="$BASE_DIR/../avocado-static-checks.conf"

Expand Down Expand Up @@ -70,8 +71,8 @@ if [ -f "$CONFIG_FILE" ]; then
FILES=$(git ls-files "$DIRECTORY_PATH/*.py")

if [ -n "$FILES" ]; then
echo "** Running $TOOL_CMD on directory '$DIRECTORY_PATH' with config from '$CONFIG_PATH'..."
python3 -m pylint --rcfile="$BASE_DIR/../$CONFIG_PATH" $FILES
echo "** Running $TOOL_NAME on directory '$DIRECTORY_PATH' with config from '$CONFIG_PATH'..."
$TOOL_CMD --rcfile="$BASE_DIR/../$CONFIG_PATH" $FILES

# Add the files to the custom config list
for file in $FILES; do
Expand All @@ -82,8 +83,8 @@ if [ -f "$CONFIG_FILE" ]; then
done < "$CONFIG_FILE"
else
# If the configuration file does not exist, print a message and use default config for all files
echo "Configuration file '$CONFIG_FILE' not found. Running $TOOL_CMD with default config on all files..."
python3 -m pylint --rcfile="$DEFAULT_CONFIG_PATH" $ALL_FILES
echo "Configuration file '$CONFIG_FILE' not found. Running $TOOL_NAME with default config on all files..."
$TOOL_CMD --rcfile="$DEFAULT_CONFIG_PATH" $ALL_FILES
exit 0
fi

Expand All @@ -97,6 +98,6 @@ for file in $ALL_FILES; do
done

if [ ${#remaining_files[@]} -gt 0 ]; then
echo "** Running $TOOL_CMD with default config on remaining files..."
python3 -m pylint --rcfile="$DEFAULT_CONFIG_PATH" "${remaining_files[@]}"
echo "** Running $TOOL_NAME with default config on remaining files..."
$TOOL_CMD --rcfile="$DEFAULT_CONFIG_PATH" "${remaining_files[@]}"
fi
9 changes: 4 additions & 5 deletions check-style
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
#!/bin/sh -e

TOOL_CMD=black
PATH=$(basename $0)/utils:$PATH
TOOL_PATH=$(which $TOOL_CMD)
TOOL_NAME=black
TOOL_CMD="python3 -m black"

echo "** Running $TOOL_CMD ($TOOL_PATH)..."
$TOOL_PATH --check --diff --color .
echo "** Running $TOOL_NAME..."
$TOOL_CMD --check --diff --color .
22 changes: 0 additions & 22 deletions utils/which

This file was deleted.