-
Notifications
You must be signed in to change notification settings - Fork 19
Open
Labels
Description
IMPORTANT: Before submitting, please remove all sensitive data, secrets, tokens, or confidential information. Ensure you've redacted any NDA-covered information, IP addresses, resource names, or security-related details that shouldn't be publicly disclosed.
Problem Statement
ShellCheck currently runs via MegaLinter without a dedicated configuration file. This means:
- Shell dialect defaults must be auto-detected per file
- Optional checks like
require-variable-bracesare not enabled - SC1091 requires 10 individual inline
# shellcheck disable=directives across 13 files - Direct tool usage outside MegaLinter requires manual flag configuration
Proposed Solution
Create .shellcheckrc configuration file at repository root with project-specific settings:
# ShellCheck configuration for edge-ai repository
shell=bash
source-path=SCRIPTDIR
external-sources=true
enable=require-variable-braces
enable=require-double-brackets
enable=deprecate-which
disable=SC1091Integrate with MegaLinter by adding to .mega-linter.yml:
BASH_SHELLCHECK_CONFIG_FILE: .shellcheckrcAlternative Solutions
- Continue using inline directives (increases maintenance burden)
- Use only MegaLinter defaults (misses optional checks aligned with bash.instructions.md)
Target Components
- Terraform modules
- Bicep modules
- Blueprints
- GitHub Actions
- Documentation
- Other: MegaLinter configuration, shell scripts
Implementation Ideas
- Create
.shellcheckrcat repository root - Add
BASH_SHELLCHECK_CONFIG_FILE: .shellcheckrcto.mega-linter.yml - Review and remove redundant inline
# shellcheck disable=SC1091directives (10 occurrences) - Validate with
shellcheck -x scripts/*.sh
Additional Context
| Metric | Value |
|---|---|
| Shell Scripts in Repo | 96 files |
| Shell Dialect | 96% Bash |
| Existing Inline Directives | 19 across 13 files |
Benefits
- Enables optional checks aligned with
.github/instructions/bash.instructions.md - Eliminates 10 redundant inline disable directives
- Enables direct ShellCheck usage outside MegaLinter
- Centralizes shell script linting configuration
Potential Challenges
- May surface new warnings from enabled optional checks (require-variable-braces, require-double-brackets)
- Some scripts may need updates to comply with stricter rules