when:
  - event: [pull_request]
  - event: push
    branch:
      - ${CI_REPO_DEFAULT_BRANCH}

steps:
  lint-markdown:
    image: davidanson/markdownlint-cli2:v0.20.0
    commands:
      - 'markdownlint-cli2 **/*.md'
    when:
      path:
        include: ['.woodpecker/*.yaml', '*.{md,markdown}']

  editor-config:
    image: mstruebing/editorconfig-checker:v3.6.1
    depends_on: []

  prettier:
    image: docker.io/woodpeckerci/plugin-prettier:1.4.1
    depends_on: []
    settings:
      # renovate: datasource=npm depName=prettier
      version: 3.9.4

  links:
    image: lycheeverse/lychee:0.22.0
    depends_on: []
    commands:
      - lychee -v -t 40 --root-dir $(pwd)/content --fallback-extensions md .

  lint-yaml:
    image: pipelinecomponents/yamllint:0.35.13
    depends_on: []
    commands:
      - yamllint --strict .
    when:
      path: '*.{yml,yaml}'

  spellcheck:
    image: docker.io/node:24-alpine
    depends_on: []
    commands:
      - npm install -g corepack@latest
      - corepack enable
      - pnpx cspell lint --no-progress --gitignore '{**,.*}/{*,.*}'
