Skip to content
Merged
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
7 changes: 6 additions & 1 deletion .github/workflows/reusable-18-autofix.yml
Original file line number Diff line number Diff line change
Expand Up @@ -541,7 +541,12 @@ jobs:
done
for dir in "${filtered_py_dirs[@]}"; do
clean_dir="${dir#./}"
if [[ -n "$clean_dir" ]]; then allowed_patterns+=("${clean_dir}/**"); fi
# Handle root directory: "." or empty becomes "**" to match all files
if [[ -z "$clean_dir" || "$clean_dir" == "." ]]; then
Copy link

Copilot AI Dec 29, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The condition checking for "$clean_dir" == "." is redundant. After the parameter expansion "${dir#./}", if dir is ., then clean_dir will be an empty string (not .). The #./ pattern removes the shortest match of ./ from the beginning, so . becomes empty. Therefore, checking [[ -z "$clean_dir" ]] alone is sufficient to catch this case.

Suggested change
if [[ -z "$clean_dir" || "$clean_dir" == "." ]]; then
if [[ -z "$clean_dir" ]]; then

Copilot uses AI. Check for mistakes.
allowed_patterns+=("**")
else
allowed_patterns+=("${clean_dir}/**")
fi
done
if [ ${#allowed_patterns[@]} -eq 0 ]; then allowed_patterns=("**/*.py"); fi
fi
Expand Down
Loading