diff --git a/DIRECTORY.md b/DIRECTORY.md index 5bb206e08c0e..c69605273647 100644 --- a/DIRECTORY.md +++ b/DIRECTORY.md @@ -462,6 +462,7 @@ ## Fuzzy Logic * [Fuzzy Operations](fuzzy_logic/fuzzy_operations.py) + * [Fuzzy Set Operations](fuzzy_logic/fuzzy_set_operations.py) ## Genetic Algorithm * [Basic String](genetic_algorithm/basic_string.py) diff --git a/scripts/close_pull_requests_with_awaiting_changes.sh b/scripts/close_pull_requests_with_awaiting_changes.sh index 55e19c980596..3ea8445394d9 100755 --- a/scripts/close_pull_requests_with_awaiting_changes.sh +++ b/scripts/close_pull_requests_with_awaiting_changes.sh @@ -1,22 +1,7 @@ #!/bin/bash - -# List all open pull requests -prs=$(gh pr list --state open --json number,title,labels --limit 500) - -# Loop through each pull request -echo "$prs" | jq -c '.[]' | while read -r pr; do - pr_number=$(echo "$pr" | jq -r '.number') - pr_title=$(echo "$pr" | jq -r '.title') - pr_labels=$(echo "$pr" | jq -r '.labels') - - # Check if the "awaiting changes" label is present - awaiting_changes=$(echo "$pr_labels" | jq -r '.[] | select(.name == "awaiting changes")') - echo "Checking PR #$pr_number $pr_title ($awaiting_changes) ($pr_labels)" - - # If awaiting_changes, close the pull request - if [[ -n "$awaiting_changes" ]]; then - echo "Closing PR #$pr_number $pr_title due to awaiting_changes label" - gh pr close "$pr_number" --comment "Closing awaiting_changes PRs to prepare for Hacktoberfest" - sleep 2 - fi -done +# +# Close every open pull request labelled "awaiting changes". +# Thin wrapper around close_pull_requests_with_label.sh so all five backlog +# jobs share one implementation. Set DRY_RUN=1 to preview. +set -euo pipefail +exec "$(dirname "$0")/close_pull_requests_with_label.sh" "awaiting changes" "$@" diff --git a/scripts/close_pull_requests_with_failing_tests.sh b/scripts/close_pull_requests_with_failing_tests.sh index 3ec5960aed27..1acaefaa35ee 100755 --- a/scripts/close_pull_requests_with_failing_tests.sh +++ b/scripts/close_pull_requests_with_failing_tests.sh @@ -1,22 +1,7 @@ #!/bin/bash - -# List all open pull requests -prs=$(gh pr list --state open --json number,title,labels --limit 500) - -# Loop through each pull request -echo "$prs" | jq -c '.[]' | while read -r pr; do - pr_number=$(echo "$pr" | jq -r '.number') - pr_title=$(echo "$pr" | jq -r '.title') - pr_labels=$(echo "$pr" | jq -r '.labels') - - # Check if the "tests are failing" label is present - tests_are_failing=$(echo "$pr_labels" | jq -r '.[] | select(.name == "tests are failing")') - echo "Checking PR #$pr_number $pr_title ($tests_are_failing) ($pr_labels)" - - # If there are failing tests, close the pull request - if [[ -n "$tests_are_failing" ]]; then - echo "Closing PR #$pr_number $pr_title due to tests_are_failing label" - gh pr close "$pr_number" --comment "Closing tests_are_failing PRs to prepare for Hacktoberfest" - sleep 2 - fi -done +# +# Close every open pull request labelled "tests are failing". +# Thin wrapper around close_pull_requests_with_label.sh so all five backlog +# jobs share one implementation. Set DRY_RUN=1 to preview. +set -euo pipefail +exec "$(dirname "$0")/close_pull_requests_with_label.sh" "tests are failing" "$@" diff --git a/scripts/close_pull_requests_with_label.sh b/scripts/close_pull_requests_with_label.sh new file mode 100755 index 000000000000..bdf7d19f2b51 --- /dev/null +++ b/scripts/close_pull_requests_with_label.sh @@ -0,0 +1,63 @@ +#!/bin/bash +# +# Close every open pull request that carries a given label, leaving an +# explanatory comment. This is used to clear the backlog before Hacktoberfest. +# +# Usage: +# scripts/close_pull_requests_with_label.sh "