Skip to content

Commit 5d8213d

Browse files
feat(lint): add shellcheck for shell script verification
1 parent 432df59 commit 5d8213d

7 files changed

Lines changed: 33 additions & 13 deletions

File tree

.devcontainer/Dockerfile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
FROM mcr.microsoft.com/devcontainers/base:bookworm
22

33
# [Optional] Uncomment this section to install additional OS packages.
4-
# RUN apt-get update && export DEBIAN_FRONTEND=noninteractive \
5-
# && apt-get -y install --no-install-recommends <your-package-list-here>
4+
RUN apt-get update && export DEBIAN_FRONTEND=noninteractive \
5+
&& apt-get -y install --no-install-recommends shellcheck
66

77
# [Optional] Uncomment if you want to install an additional version of node using nvm
88
# ARG EXTRA_NODE_VERSION=10

.github/workflows/shellcheck.yml

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
name: Shell Script Linting
2+
3+
on:
4+
push:
5+
branches: [ main, booting ]
6+
pull_request:
7+
branches: [ main ]
8+
9+
jobs:
10+
shellcheck:
11+
runs-on: ubuntu-latest
12+
steps:
13+
- name: Checkout code
14+
uses: actions/checkout@v4
15+
16+
- name: Run shellcheck
17+
run: |
18+
shellcheck install.sh .devcontainer/*.sh scripts/*.sh templates/scripts/*.sh

Makefile

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,9 @@ build: ## Create a production build
2323
@echo "Build target not implemented yet — update after choosing your tech stack"
2424

2525
lint: ## Run code formatting & linting
26-
@echo "Lint target not implemented yet — update after choosing your tech stack"
26+
@echo "🔍 Linting shell scripts..."
27+
@shellcheck install.sh .devcontainer/*.sh scripts/*.sh templates/scripts/*.sh || (echo "❌ Shellcheck failed. Fix errors above." && exit 1)
28+
@echo "✅ Shell scripts linted."
2729

2830
clean: ## Remove build artifacts
2931
@echo "Clean target not implemented yet — update after choosing your tech stack"

scripts/setup-env.sh

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,19 +13,19 @@ if [ ! -f .env ]; then
1313
fi
1414

1515
echo "Setting up environment variables..."
16-
read -p "Enter your Git Name: " GIT_NAME
17-
read -p "Enter your Git Email: " GIT_EMAIL
16+
read -rp "Enter your Git Name: " GIT_NAME
17+
read -rp "Enter your Git Email: " GIT_EMAIL
1818

1919
echo ""
2020
echo "Optional: SSH Public Key for commit signing."
2121
echo "If you use 1Password as your SSH agent, you can copy the public key string directly."
2222
echo "(e.g., ssh-ed25519 AAAAC3Nz...)"
23-
read -p "Enter your SSH Public Key (press Enter to skip): " SSH_PUBLIC_KEY
23+
read -rp "Enter your SSH Public Key (press Enter to skip): " SSH_PUBLIC_KEY
2424

2525
echo ""
2626
echo "Optional: The Gemini API Key is used by the Gemini CLI inside this Devcontainer."
2727
echo "You can get an API key from: https://aistudio.google.com/app/apikey"
28-
read -p "Enter your Gemini API Key (press Enter to skip): " GEMINI_API_KEY
28+
read -rp "Enter your Gemini API Key (press Enter to skip): " GEMINI_API_KEY
2929

3030
echo ""
3131
echo "Optional: Authenticate with GitHub CLI for automations inside the Devcontainer."

scripts/troubleshooting.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ echo "🔍 Starting Devcontainer Troubleshooting..."
55
echo "----------------------------------------"
66

77
# Change to the repository root relative to the script's location
8-
cd "$(dirname "${BASH_SOURCE[0]}")/.."
8+
cd "$(dirname "${BASH_SOURCE[0]}")/.." || exit
99

1010
ISSUE_FOUND=0
1111

templates/scripts/setup-env.sh

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,19 +13,19 @@ if [ ! -f .env ]; then
1313
fi
1414

1515
echo "Setting up environment variables..."
16-
read -p "Enter your Git Name: " GIT_NAME
17-
read -p "Enter your Git Email: " GIT_EMAIL
16+
read -rp "Enter your Git Name: " GIT_NAME
17+
read -rp "Enter your Git Email: " GIT_EMAIL
1818

1919
echo ""
2020
echo "Optional: SSH Public Key for commit signing."
2121
echo "If you use 1Password as your SSH agent, you can copy the public key string directly."
2222
echo "(e.g., ssh-ed25519 AAAAC3Nz...)"
23-
read -p "Enter your SSH Public Key (press Enter to skip): " SSH_PUBLIC_KEY
23+
read -rp "Enter your SSH Public Key (press Enter to skip): " SSH_PUBLIC_KEY
2424

2525
echo ""
2626
echo "Optional: The Gemini API Key is used by the Gemini CLI inside this Devcontainer."
2727
echo "You can get an API key from: https://aistudio.google.com/app/apikey"
28-
read -p "Enter your Gemini API Key (press Enter to skip): " GEMINI_API_KEY
28+
read -rp "Enter your Gemini API Key (press Enter to skip): " GEMINI_API_KEY
2929

3030
echo ""
3131
echo "Optional: Authenticate with GitHub CLI for automations inside the Devcontainer."

templates/scripts/troubleshooting.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ echo "🔍 Starting Devcontainer Troubleshooting..."
55
echo "----------------------------------------"
66

77
# Change to the repository root relative to the script's location
8-
cd "$(dirname "${BASH_SOURCE[0]}")/.."
8+
cd "$(dirname "${BASH_SOURCE[0]}")/.." || exit
99

1010
ISSUE_FOUND=0
1111

0 commit comments

Comments
 (0)