---
variables:
  PRETTIER_DEFAULT_ARGS:
    --check --ignore-unknown --config-precedence file-override
  PRETTIER_EXTRA_ARGS: ""
  PRETTIER_CHECK_PATH: "."

docs:prettier:
  stage: test
  image:
    name: registry.gitlab.com/just-ci/images/prettier:latest
    entrypoint: []
  script:
    - |
      if ! prettier ${PRETTIER_DEFAULT_ARGS} ${PRETTIER_EXTRA_ARGS} ${PRETTIER_CHECK_PATH}; then
        echo "[!] Run the following in the root of your repository: \
        prettier --write --ignore-unknown ${PRETTIER_EXTRA_ARGS} ${PRETTIER_CHECK_PATH}"
        exit 1
      fi
