Skip to content

Conversation

@hasit
Copy link

@hasit hasit commented Dec 10, 2025

Summary by CodeRabbit

  • New Features
    • Added setup instructions for enabling Fish shell completions, guiding users through creating symbolic links and reloading shell configuration for seamless integration.

✏️ Tip: You can customize this high-level summary in your review settings.

@hasit hasit requested a review from NatoBoram as a code owner December 10, 2025 19:36
@coderabbitai
Copy link

coderabbitai bot commented Dec 10, 2025

Walkthrough

This pull request adds a shell syntax checker to the CI configuration pipeline and appends user guidance to the setup script for enabling Fish shell completions. Two straightforward additions: automated shell linting rules and documentation about Fish symlink setup.

Changes

Cohort / File(s) Summary
CI Configuration
\.coderabbit\.yaml
Adds pre_merge_checks.custom_checks entry with a shell-check rule (mode: error) that verifies shell syntax across multiple shells (bash, zsh, fish) and ensures examples exist for all supported shells.
Shell Setup Script
templates/setup-example\.sh
Appends three echo statements providing user instructions for enabling Fish shell completions, including steps to create a symlink to gtr.fish and reload the shell.

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~5 minutes

  • Configuration addition is minimal and syntactically straightforward
  • Shell script changes are purely documentation (echo statements with no logic)
  • No complex interactions or dependencies to verify

Poem

🐰 A rabbit hops through shells so fine,
Bash and fish and zsh align,
New checks in place, no syntax sins,
And setup guides that gently spin!
Shell completions, pure delight—
Our code now checks with rabbit might! 🚀

Pre-merge checks and finishing touches

Caution

Pre-merge checks failed

Please resolve all errors before merging. Addressing warnings is optional.

  • Ignore
❌ Failed checks (1 error, 1 inconclusive)
Check name Status Explanation Resolution
Shell-Check ❌ Error The custom check contains a spelling error: 'sytactically' should be 'syntactically'. Additionally, instructions lack specificity about which shell scripts to validate and criteria for examples. Correct 'sytactically' to 'syntactically' and clarify which shells require validation and what constitutes valid examples.
Title check ❓ Inconclusive The pull request title '@coderabbitai' is not descriptive and does not convey any meaningful information about the changeset, which adds shell-check configuration and Fish shell completion guidance. Replace the title with a descriptive summary of the main change, such as 'Add shell syntax validation and Fish shell completion instructions' or 'Configure shell-check and document Fish completions'.
✅ Passed checks (2 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment

Comment @coderabbitai help to get the list of available commands and usage tips.

@coderabbitai coderabbitai bot changed the title @coderabbitai Add shell syntax checker to CI and Fish completion documentation Dec 10, 2025
Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 1

📜 Review details

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Disabled knowledge base sources:

  • Linear integration is disabled by default for public repositories

You can enable these sources in your CodeRabbit configuration.

📥 Commits

Reviewing files that changed from the base of the PR and between 9fd4e85 and 2ec73e9.

📒 Files selected for processing (2)
  • .coderabbit.yaml (1 hunks)
  • templates/setup-example.sh (1 hunks)
🧰 Additional context used
📓 Path-based instructions (2)
**/*.sh

📄 CodeRabbit inference engine (.github/copilot-instructions.md)

**/*.sh: Always quote paths to handle spaces and special characters; avoid unguarded globbing
Keep set -e active in shell scripts; ensure non-critical failures are guarded with command || true

**/*.sh: Use shebang #!/usr/bin/env bash (not /bin/bash or /bin/sh)
Use snake_case naming for functions
Use snake_case for local variables and UPPER_CASE for constants/environment variables
Use 2-space indentation (no tabs)
Always quote variables and paths to handle spaces and special characters
Check return codes and use || exit 1 or || return 1 for error handling
Use local for function-scoped variables to avoid polluting global namespace
Target Bash 3.2+ compatibility in shell scripts

Files:

  • templates/setup-example.sh
**/*.{bash,fish,sh}

📄 CodeRabbit inference engine (.github/instructions/sh.instructions.md)

**/*.{bash,fish,sh}: Bash 3.2+ compatible (macOS default), but 4.0+ features allowed where appropriate
Always quote variables: use "$var" not $var
Use function-scoped variables: local var="value"
Check return codes; functions return 1 on failure
Use snake_case for functions and variables, UPPER_CASE for constants
Prefer [ ] over [[ ]] for POSIX portability; use [[ only when needed
Always quote glob inputs; disable unintended globbing with set -f temporarily if required
Avoid associative arrays in shell scripts; use simple string/loop constructs for Bash 3.2+ compatibility
Avoid readarray and process substitution unsupported in older Bash
Debug with bash -x ./bin/gtr <cmd> or wrap suspicious blocks with set -x / set +x
Check function presence with declare -f create_worktree or declare -f resolve_target
Use stderr for variable inspection: echo "DEBUG var=$var" >&2 to keep stdout clean for command substitution
Keep dependencies minimal: only use git, sed, awk, find, grep; avoid jq/curl unless justified
Check availability of external commands before use when adding new tools
Use "${var}" for variable expansion; for line loops use while IFS= read -r line; do ... done to preserve spaces
Sanitize branch names via sanitize_branch_name function; do NOT duplicate logic elsewhere
Everything is sourced at startup with set -e enabled; functions call each other directly; no subshells except for hooks and AI tools

Files:

  • templates/setup-example.sh
🔇 Additional comments (1)
templates/setup-example.sh (1)

37-40: Verify that completions/gtr.fish exists in the repository.

The Fish shell completion guidance references a hardcoded placeholder path (/path/to/git-worktree-runner/completions/gtr.fish). While placeholder paths are acceptable in example documentation for user customization, confirm that the actual gtr.fish file exists in the completions/ directory to ensure the instructions are actionable. If the file doesn't exist, either create it or update the documentation to reflect the current state.

Comment on lines +19 to +25
pre_merge_checks:
custom_checks:
- mode: error
name: shell-check
instructions: |
- Always check if the shell scripts are valid and sytactically correct.
- Make sure there are examples for all the supported shells, such as bash, zsh, fish, etc.
Copy link

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟡 Minor

Fix typo in shell-check instructions.

Line 24 contains "sytactically" which should be "syntactically".

  pre_merge_checks:
    custom_checks:
      - mode: error
        name: shell-check
        instructions: |
-         - Always check if the shell scripts are valid and sytactically correct.
+         - Always check if the shell scripts are valid and syntactically correct.
          - Make sure there are examples for all the supported shells, such as bash, zsh, fish, etc.
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
pre_merge_checks:
custom_checks:
- mode: error
name: shell-check
instructions: |
- Always check if the shell scripts are valid and sytactically correct.
- Make sure there are examples for all the supported shells, such as bash, zsh, fish, etc.
pre_merge_checks:
custom_checks:
- mode: error
name: shell-check
instructions: |
- Always check if the shell scripts are valid and syntactically correct.
- Make sure there are examples for all the supported shells, such as bash, zsh, fish, etc.
🤖 Prompt for AI Agents
In .coderabbit.yaml around lines 19 to 25, the custom_check instruction text has
a typo: replace "sytactically" with "syntactically" in the shell-check
instructions so the line reads "Always check if the shell scripts are valid and
syntactically correct." and keep the rest of the block unchanged.

@hasit hasit closed this Dec 10, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant