Use consistent bash5 style for conditionals and quoting

This commit is contained in:
David Heinemeier Hansson committed 2026-02-21 10:18:47 +01:00
1 parent d2acf3b6ba
commit 7514ae7dcf
113 files changed
+289 -287

No files matched your search

+5 -1
View File
@@ -1,7 +1,11 @@
# Style
- Two spaces for indentation, no tabs
- Use bash 5 syntax: `[[ ]]` for conditionals, not `[ ]`. Don't quote variables inside `[[ ]]` (e.g., `[[ -n $var ]]` not `[[ -n "$var" ]]`)
- Use bash 5 conditionals: use `[[ ]]` for string/file tests and `(( ))` for numeric tests
- In `[[ ]]`, don't quote variables, but do quote string literals when comparing values (e.g., `[[ $branch == "dev" ]]`)
- Prefer `(( ))` over numeric operators inside `[[ ]]` (e.g., `(( count < 50 ))`, not `[[ $count -lt 50 ]]`)
- For strings/paths with spaces, quote them instead of escaping spaces with `\ ` (e.g., `"$APP_DIR/Disk Usage.desktop"`, not `$APP_DIR/Disk\ Usage.desktop`)
- Shebangs must use `#!/bin/bash` consistently (never `#!/usr/bin/env bash`)
# Command Naming