Join GitHub today
GitHub is home to over 36 million developers working together to host and review code, manage projects, and build software together.Sign up
Convert `check_banned_imports.sh` to Python to workaround Bash array issues and for less duplication #7702
The current bash script violates Shellcheck for not properly quoting a variable. However, fixing this breaks the behavior and there is no simple way to fix it by converting the result of
This is not the first time the bash script has been difficult to work with. For example, #6747 took 26 commits to land and several back-and-forth code snippets over Slack.
Finally, the bash script has much duplication in it.
Rewrite to modern Python 3.
Bad imports will be caught the same as before.
To de-duplicate logic, the printed user message is a bit different, however. The failure message is also now outputted in red.