@codacy/tools-hadolint-2
v0.2.0
Published
Hadolint adapter — CLI-mode Dockerfile linter
Readme
@codacy/tools-hadolint-2
Table of Contents
Overview
Dockerfile linter using the Hadolint binary. Uses the CLI execution strategy — spawns hadolint via spawnTool() and parses its JSON output.
| Property | Value |
|----------|-------|
| Tool ID | Hadolint |
| Codacy UUID | d3ec07a8-71b3-4b89-a25e-9c32ef827668 |
| Strategy | CLI |
| Languages | Dockerfile |
| Binary | hadolint |
| File patterns | **/Dockerfile, **/*.dockerfile |
Updating patterns
# Re-fetch pattern metadata from the Codacy API
pnpm prefetch
# Commit the result
git add src/patterns.jsonPattern IDs follow the format Hadolint_DL3006, Hadolint_SC2086, etc. Note the capital H — the tool ID matches the Codacy API prefix exactly.
Hadolint also includes ShellCheck rules for RUN instructions, so pattern IDs with SC prefixes are expected.
Updating the Hadolint version
- Update
preferredVersioninsrc/adapter.ts - Update the download URL template if the release format changed
- Run
pnpm prefetchto check for new/removed rules - Run
pnpm testto verify compatibility - If the major version changes, create a new adapter package (
hadolint-3/)
Development
pnpm build # Build with tsup
pnpm test # Run tests (requires hadolint in PATH or auto-install)Notes for maintainers
- Hadolint is a single static binary (Haskell), downloaded from GitHub releases.
- The binary is downloaded via
downloadFile()(notdownloadAndExtract()— it's not an archive). - JSON output via
--format json.
