This pre-commit hook performs shellcheck on script tasks in Azure Devops pipeline yaml files.
The validate shell snippets hook extracts (bash) shell script snippets from AZDO pipeline yaml files. Shellcheck is executed for each snippet encountered.
AZDO parameter or variable references (with the ${{ par }}
syntax) are converted into
shell variabel references to prevent errors.
The Shellcheck is configured to ignore SC2154
since these variables are provided from
outside the script snippets.
In your .pre-commit-config.yaml
use the following config:
- repo: https://github.com/krisgeus/azdo-inline-script-shellcheck
rev: v2.0.2
hooks:
- id: validate-shell-snippets
name: Check shell snippets in yaml files
language: docker
entry: /bin/validate-shell-snippets
Same as Validate Shell Snippets but using the pre-built docker image (tag latest)
In your .pre-commit-config.yaml
use the following config:
- repo: https://github.com/krisgeus/azdo-inline-script-shellcheck
rev: v2.0.2
hooks:
- id: validate-shell-snippets-docker-latest
name: Check shell snippets in yaml files
Same as Validate Shell Snippets but using the pre-built docker image from the release (tag v2.0.2)
In your .pre-commit-config.yaml
use the following config:
- repo: https://github.com/krisgeus/azdo-inline-script-shellcheck
rev: v2.0.2
hooks:
- id: validate-shell-snippets-docker-release
name: Check shell snippets in yaml files
The validate powershell snippets hook extracts (pwsh) shell script snippets from AZDO pipeline yaml files. PSScriptAnalyzer is executed for each snippet encountered.
AZDO parameter or variable references (with the ${{ par }}
syntax) are converted into
powershell variabel references to prevent errors.
In your .pre-commit-config.yaml
use the following config:
- repo: https://github.com/krisgeus/azdo-inline-script-shellcheck
rev: v2.0.2
hooks:
- id: validate-powershell-snippets
name: Check powershell snippets in yaml files
language: docker
entry: /bin/validate-pwsh-snippets
The validate Powershell snippets hook extracts powershell script snippets from AZDO pipeline yaml files. PSScriptAnalyzer is executed for each snippet encountered.
AZDO parameter or variable references (with the ${{ par }}
syntax) are converted into
powershell variabel references to prevent errors.
The hook is using the pre-built docker image (tag latest)
In your .pre-commit-config.yaml
use the following config:
- repo: https://github.com/krisgeus/azdo-inline-script-shellcheck
rev: v2.0.2
hooks:
- id: validate-powershell-snippets-docker-latest
name: Check shell snippets in yaml files
Same as Validate Powershell Snippets but using the pre-built docker image from the release (tag v2.0.2)
In your .pre-commit-config.yaml
use the following config:
- repo: https://github.com/krisgeus/azdo-inline-script-shellcheck
rev: v2.0.2
hooks:
- id: validate-powershell-snippets-docker-release
name: Check shell snippets in yaml files