Fix TODO items and shell script best practices#158
Conversation
Resolve straightforward tasks from in-code TODOs and shell standards: - mpv.conf: Resolve scaling TODO, use ewa_lanczossharp for best quality - appImage_to_desktop.sh: Add -u flag to set, quote variables per standards - killwine.sh: Rewrite with proper error handling, use mapfile, avoid unsafe patterns - proton-cachyos.sh: Fix shebang to #!/usr/bin/env bash, add set -euo pipefail All changes align with repo standards: proper error handling, quoted variables, and bash idioms per CLAUDE.md guidelines.
Learn moreAll Green is an AI agent that automatically: ✅ Addresses code review comments ✅ Fixes failing CI checks ✅ Resolves merge conflicts |
|
🤖 Hi @Ven0m0, I've received your request, and I'm working on it now! You can track my progress in the logs for more details. |
Summary of ChangesHello @Ven0m0, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed! This pull request focuses on enhancing the quality, robustness, and adherence to best practices across several configuration and shell script files. It addresses existing technical debt by resolving TODOs, implementing safer variable handling, and improving error management, resulting in more reliable and maintainable code. Highlights
Using Gemini Code AssistThe full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips. Invoking Gemini You can request assistance from Gemini at any point by creating a comment using either
Customization To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a Limitations & Feedback Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here. You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension. Footnotes
|
|
🤖 I'm sorry @Ven0m0, but I was unable to process your request. Please see the logs for more details. |
There was a problem hiding this comment.
Pull request overview
This PR resolves straightforward TODO items and applies shell script best practices across multiple configuration and script files. The changes focus on standardizing error handling, variable quoting, and resolving a configuration decision in mpv.
Changes:
- Updated shell scripts to use portable
#!/usr/bin/env bashshebang and properset -euo pipefailflags - Rewrote killwine.sh with safe process handling using mapfile and proper error suppression
- Added variable quoting in appImage_to_desktop.sh for path variables
- Resolved mpv.conf TODO by selecting ewa_lanczossharp scaling algorithm with explanatory comment
Reviewed changes
Copilot reviewed 1 out of 4 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| Home/.local/bin/proton-cachyos.sh | Added portable shebang and set -euo pipefail for proper error handling |
| Home/.local/bin/killwine.sh | Complete rewrite with safe process killing using mapfile, error handling, and avoiding command substitution vulnerabilities |
| Home/.local/bin/appImage_to_desktop.sh | Added -u flag to set command and quoted TEMP_SQUASHFS_PATH variable references |
| Home/.config/mpv/mpv.conf | Resolved TODO by selecting ewa_lanczossharp for scale/cscale with explanatory comment |
There was a problem hiding this comment.
Code Review
This pull request introduces a series of valuable improvements across configuration and shell scripts, aligning with modern best practices. The changes in mpv.conf, appImage_to_desktop.sh, and proton-cachyos.sh are solid, particularly the adoption of set -euo pipefail and proper variable quoting in the shell scripts. The rewrite of killwine.sh is a significant step up in terms of safety and correctness. I've added one suggestion to make it even more robust and idiomatic by using pkill instead of a ps | grep | awk pipeline. Overall, these are great changes that enhance the quality and reliability of the scripts.
| mapfile -t pids < <(ps -ef | grep -E -i '(wine|processid|\.exe)' | grep -v grep | awk '{print $2}') | ||
| if [[ ${#pids[@]} -gt 0 ]]; then | ||
| kill -9 "${pids[@]}" 2>/dev/null || true | ||
| fi |
There was a problem hiding this comment.
The logic for finding and killing processes can be significantly simplified and made more robust by using pkill. This single command can replace the mapfile, ps, grep, awk, if, and kill combination, making the script more readable and idiomatic. pkill with the -f flag will match against the full command line, and it's designed to avoid matching itself, making it safer than a ps | grep pipeline.
| mapfile -t pids < <(ps -ef | grep -E -i '(wine|processid|\.exe)' | grep -v grep | awk '{print $2}') | |
| if [[ ${#pids[@]} -gt 0 ]]; then | |
| kill -9 "${pids[@]}" 2>/dev/null || true | |
| fi | |
| pkill -f -9 -i 'wine|processid|\.exe' 2>/dev/null || true |

Resolve straightforward tasks from in-code TODOs and shell standards:
All changes align with repo standards: proper error handling, quoted variables, and bash idioms per CLAUDE.md guidelines.