Skip to content

fix: apply 4-space indentation standard to all shell scripts#55

Closed
maxrantil wants to merge 5 commits intomasterfrom
fix/issue-54-shell-formatting
Closed

fix: apply 4-space indentation standard to all shell scripts#55
maxrantil wants to merge 5 commits intomasterfrom
fix/issue-54-shell-formatting

Conversation

@maxrantil
Copy link
Owner

Summary

Fixes shell formatting issues flagged by the new CI/CD workflows (PR #53). Applies shfmt formatting with -i 4 -ci -sr flags to all shell scripts.

Fixes: #54
Priority: HIGH (blocking CI/CD implementation)


Changes Made

Formatting Applied

  • Redirect operators: Add spaces (2> /dev/null instead of 2>/dev/null)
  • Indentation: Consistent 4-space indentation
  • Case statements: Proper case indentation
  • Simplified redirects: Per shfmt -sr flag

Files Formatted

  • provision-vm.sh (97 changes)
  • destroy-vm.sh
  • tests/test_local_dotfiles.sh
  • tests/test_ansible_variables.sh
  • tests/test_ssh_key_validation.sh

Verification

Local Testing

# All tests still passing
./tests/test_local_dotfiles.sh
# Total tests run: 66
# Passed: 66
# Failed: 0

# Formatting verification
shfmt -d -i 4 -ci -sr provision-vm.sh tests/*.sh
# No output = all files compliant

Pre-commit Hooks

✅ All pre-commit hooks passed


Expected CI Results

  • ✅ ShellCheck: Should pass (was already passing)
  • ✅ Shell Format Check: Should now pass (was failing)
  • ✅ AI Attribution Check: Should pass (no attribution found)
  • ✅ Pre-commit: Should pass
  • ✅ Conventional Commits: Should pass

Impact


Related

maxrantil and others added 4 commits October 10, 2025 15:13
Add 5 GitHub Actions workflows to validate infrastructure changes:
- shell-quality.yml: ShellCheck and shfmt for bash scripts
- commit-format.yml: Conventional commit validation
- verify-session-handoff.yml: Session handoff documentation check
- pr-title-check.yml: PR title format validation
- protect-master.yml: Block direct pushes to master

All workflows use reusable workflows from maxrantil/.github@master.

This closes the critical gap of having zero CI/CD validation for
607 lines of infrastructure code (Terraform, Ansible, bash scripts).

Resolves: #48 (or latest issue number)

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
Add 2 additional GitHub Actions workflows:
- block-ai-attribution.yml: Blocks PRs with AI tool attribution
- pre-commit-validation.yml: Runs pre-commit hooks in CI

This brings vm-infra to full parity with project-templates
standard workflow set (7 total workflows).

All workflows use reusable workflows from maxrantil/.github@master.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
Add workflow to validate PR body/description for AI attribution,
completing the coverage alongside commit and issue checks.

Uses new pr-body-ai-attribution-check-reusable workflow from
maxrantil/.github (feature branch for testing).

Once the .github PR is merged, this will be updated to @master.
Now that the reusable workflow is merged to master in .github repo,
update the reference from feature branch to @master.
@maxrantil maxrantil force-pushed the fix/issue-54-shell-formatting branch from 66b35f6 to 4825b4c Compare October 10, 2025 13:58
@maxrantil maxrantil changed the title Fix shell formatting to comply with CI/CD requirements (Fixes #54) fix: apply 4-space indentation standard to all shell scripts Oct 10, 2025
@maxrantil maxrantil force-pushed the fix/issue-54-shell-formatting branch from 4825b4c to 8c4a626 Compare October 10, 2025 14:09
Update CI workflow to use 4-space indentation standard.
Apply shfmt formatting with -i 4 -ci -sr flags:
- Add spaces around redirect operators (2> instead of 2>)
- Consistent 4-space indentation
- Case statement indentation
- Simplified redirects

Files formatted:
- provision-vm.sh
- destroy-vm.sh
- tests/test_local_dotfiles.sh
- tests/test_ansible_variables.sh
- tests/test_ssh_key_validation.sh
- .github/workflows/shell-quality.yml (updated to 4-space)

All 66 tests still passing after formatting changes.

Fixes #54
@maxrantil
Copy link
Owner Author

Closing to consolidate commits. Reopening with clean single commit in new PR.

@maxrantil maxrantil closed this Oct 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.

Fix shell formatting issues flagged by CI/CD

1 participant