Shell Lint ve Test

Validate Bash scripts with syntax checks, ShellCheck, shfmt, and BATS tests.

7|2|Updated Dec 16, 2025
One-click install
npx skills add https://github.com/ahm3t0t/bigfive-updater --skill shell-lint-ve-test-ahm3t0t
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: Shell Lint ve Test
Source: https://github.com/ahm3t0t/bigfive-updater/tree/main/.agents/skills/shell-lint-and-test
Command: npx skills add https://github.com/ahm3t0t/bigfive-updater --skill shell-lint-ve-test-ahm3t0t

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This skill helps you detect syntax errors, style issues, and failing behavior in Bash shell scripts before changes reach CI or production environments.

Core Features & Use Cases

  • Syntax validation: Runs bash -n checks across key scripts to catch broken quoting, missing fi/done, and other parse-time problems early.
  • Linting with ShellCheck: Executes ShellCheck with the project’s intended severity (warning) and documents known disables like SC2059.
  • Behavioral testing with BATS: Runs BATS test suites (and optional filtered tests) to verify flags, functions, and interactive/non-interactive behavior.
  • Optional coverage with kcov: Generates coverage reports to identify untested paths.

Use Case Example: Before releasing an update script for a multi-distro installer, run the full lint + format + test pipeline to prevent regressions in distro detection, install flow, and i18n output formatting.

Quick Start

Run ShellCheck, shfmt style checks, and BATS tests for guncel, install.sh, and release.sh as described in this skill to confirm everything still works.

Frequently Asked Questions about Shell Lint ve Test

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I run ShellCheck and BATS tests to validate Bash scripts before CI?

Verify Bash script correctness by running syntax checks, ShellCheck lint rules, shfmt formatting comparisons, and BATS behavioral tests. This pipeline catches syntax errors, style issues, and failing behavior in shell scripts before changes reach CI.

What is the best way to catch shell script bugs like missing fi or broken quoting?

Run bash -n syntax validation across key scripts to catch broken quoting, missing fi/done statements, and other parse-time problems early. This identifies structural errors before executing the shell script.

Do I need to install shellcheck, shfmt, and bats locally to lint shell scripts?

Yes, you need shellcheck, shfmt, and bats available locally to execute the validation pipeline. The skill requires these tools to perform syntax checks, formatting comparisons, and behavioral tests.

Can I run BATS tests to verify CLI flags and i18n behavior in install scripts?

Yes, you can run BATS test suites to verify CLI flags, function presence, and i18n behavior in install scripts. Optional filtered tests can target specific interactive or non-interactive behavior paths.

How does shfmt formatting comparison work during shell script linting?

shfmt formatting comparison checks shell scripts against standard formatting rules during the linting pipeline. It runs alongside ShellCheck to ensure code style consistency and prevent formatting regressions.

What are the limitations of using ShellCheck with documented exceptions like SC2059?

ShellCheck runs at warning severity but allows documented exceptions like SC2059. These known disables bypass specific lint rules when they conflict with project requirements or intentional script behavior.