distributable:
  url: https://github.com/hadolint/hadolint/archive/v{{version}}.tar.gz
  strip-components: 1

versions:
  github: hadolint/hadolint
  strip: /^v/

build:
  dependencies:
    haskell.org: ~9.2
    haskell.org/cabal: ^3
    git-scm.org: ^2 # cabal needs it for this one
  env:
    ARGS:
      - --jobs={{hw.concurrency}}
      - --install-method=copy
      - --installdir={{prefix}}/bin
  script: |
    cabal v2-update
    cabal v2-install $ARGS

provides:
  - bin/hadolint

test:
  fixture: |
    FROM debian
  script: |
    hadolint --version | grep {{version}}
    echo $(hadolint $FIXTURE || true) | grep DL3006
