diff --git a/.github/workflows/shellcheck.yml b/.github/workflows/shellcheck.yml new file mode 100644 index 0000000..b86081e --- /dev/null +++ b/.github/workflows/shellcheck.yml @@ -0,0 +1,24 @@ +name: Lint and Test + +on: + push: + branches: [ main, 'feat/**' ] + pull_request: + branches: [ main ] + +jobs: + shellcheck: + name: ShellCheck and Validation + runs-on: ubuntu-latest + steps: + - name: Check out repository + uses: actions/checkout@v4 + + - name: Install dependencies + run: | + sudo apt-get update + sudo apt-get install -y shellcheck + + - name: Run test suite + run: | + bash tests/test_all.sh diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md new file mode 100644 index 0000000..dd39a1e --- /dev/null +++ b/CONTRIBUTING.md @@ -0,0 +1,33 @@ +# Contributing to LinuxScripts + +Thank you for your interest in improving LinuxScripts! + +## Principles & Guidelines + +1. **Standards:** + - Every script must start with `#!/usr/bin/env bash` and `set -euo pipefail`. + - Implement a `--help` / `-h` flag describing usage, options, and dependencies. + - Quote all variables properly and handle filenames containing spaces safely. + - Minimize external dependencies; prefer core POSIX / standard Linux utilities. + - Gracefully detect dependencies using `command -v`. + +2. **Safety First:** + - Default to read-only or dry-run modes where practical. + - Destructive operations (process termination, package removal, cache clearing) must require explicit user confirmation or flags. + - Never run unvalidated `rm -rf` commands. + - SSH audits and checks must remain strictly read-only. + +3. **Testing:** + - Verify syntax: `bash -n