bash/zsh-syntax
Checks the syntax of Zsh scripts with zsh -n.
Part of the bash configuration, at the recommended level. It runs at the commit stage, per file. It runs zsh.
Zsh syntax differs from Bash, so a Bash parser rejects valid Zsh programs.
What to do
Section titled “What to do”Fix the syntax at the line Zsh reports. Install zsh when the system lacks it.
Example
Section titled “Example”In a Zsh script, if then has no condition. Write a real test, such as if [[ -f "$file" ]]; then print -r -- "$file"; fi.
Turn it off
Section titled “Turn it off”Turn it off for some files, or one of its lint rules, with a reason:
gspot ignore bash/zsh-syntax --paths "<glob>" --reason "<why>"gspot ignore bash/zsh-syntax --rule <rule> --reason "<why>"