---
version: 2
updates:
  - package-ecosystem: "devcontainers"
    commit-message:
      prefix: "chore(devcontainer)"
    directory: "/"
    schedule:
      interval: weekly
    open-pull-requests-limit: 100

  - package-ecosystem: github-actions
    commit-message:
      prefix: "ci(github-actions)"
    directory: "/"
    schedule:
      interval: "weekly"
    open-pull-requests-limit: 100
    groups:
      dev-ci-tools:
        applies-to: version-updates
        patterns:
          - actions/*
          - akhilerm/tag-push-action
          - docker/*
          - googleapis/*
          - peter-evans/create-issue-from-file

  - package-ecosystem: "npm"
    commit-message:
      prefix: "deps(npm)"
    directories:
      - /dependencies
    schedule:
      interval: "weekly"
    open-pull-requests-limit: 100
    groups:
      eslint-plugins-configs:
        applies-to: version-updates
        patterns:
          - "eslint-config*"
          - "eslint-plugin*"
      next:
        applies-to: version-updates
        patterns:
          - next
          - next-pwa
      react:
        applies-to: version-updates
        patterns:
          - "react*"
          - "@babel/preset-react"
          - "@react-native/eslint-config"
      stylelint:
        applies-to: version-updates
        patterns:
          - "stylelint*"
      textlint:
        applies-to: version-updates
        patterns:
          - "textlint*"
      typescript:
        applies-to: version-updates
        patterns:
          - "@babel/preset-typescript"
          - "@typescript-eslint/eslint-plugin"
          - ts-standard
          - typescript

  - package-ecosystem: "bundler"
    commit-message:
      prefix: "deps(bundler)"
    directory: "/dependencies"
    schedule:
      interval: "weekly"
    open-pull-requests-limit: 100
    groups:
      rubocop:
        applies-to: version-updates
        patterns:
          - "rubocop*"

  - package-ecosystem: "docker"
    commit-message:
      prefix: "deps(docker)"
    directory: "/"
    schedule:
      interval: "weekly"
    open-pull-requests-limit: 100
    groups:
      docker:
        applies-to: version-updates
        # We can group all Docker dependencies because they are isolated from
        # each other
        patterns:
          - alpine/helm
          - alpine/terragrunt
          - dotenvlinter/dotenv-linter
          - dotnet/sdk
          - golang
          - golangci/golangci-lint
          - goreleaser/goreleaser
          - hadolint/hadolint
          - hashicorp/terraform
          - kustomize/kustomize
          - tenable/terrascan
          - terraform-linters/tflint
          - yannh/kubeconform
          - koalaman/shellcheck
          - mstruebing/editorconfig-checker
          - mvdan/shfmt
          - rhysd/actionlint
          - scalameta/scalafmt
          - zricethezav/gitleaks
          - yoheimuta/protolint
          - clj-kondo/clj-kondo
          - dart
          - powershell
          - composer/composer
      docker-base-images:
        applies-to: version-updates
        patterns:
          # Move the base image to a dedicated group to avoid blocking other
          # dependencies in the case of wheel not being available for more
          # recent Python version
          - python

  - package-ecosystem: "pip"
    commit-message:
      prefix: "deps(python)"
    directories:
      - /dependencies/python/
    schedule:
      interval: "weekly"
    open-pull-requests-limit: 100
    groups:
      pip:
        applies-to: version-updates
        # We can group all python dependencies because each uses its own
        # virtual environments
        patterns:
          - ansible-lint
          - black
          - cfn-lint
          - checkov
          - cpplint
          - flake8
          - isort
          - mypy
          - nbqa
          - pyink
          - pylint
          - ruff
          - snakefmt
          - snakemake
          - sqlfluff
          - yamllint

  - package-ecosystem: "gradle"
    commit-message:
      prefix: "deps(java)"
    directories:
      - "/dependencies/checkstyle"
      - "/dependencies/google-java-format"
      - "/dependencies/ktlint"
    schedule:
      interval: "weekly"
    open-pull-requests-limit: 100
    groups:
      java-gradle:
        applies-to: version-updates
        # We can group all Java dependencies because they are isolated from
        # each other
        patterns:
          - "com.google.googlejavaformat:google-java-format"
          - "com.pinterest.ktlint:ktlint-cli"
          - "com.puppycrawl.tools:checkstyle"

  - package-ecosystem: "docker"
    commit-message:
      prefix: "ci(dev-docker)"
    directory: "/dev-dependencies"
    schedule:
      interval: "weekly"
    open-pull-requests-limit: 100

  - package-ecosystem: "npm"
    commit-message:
      prefix: "ci(dev-npm)"
    directories:
      - /dev-dependencies
    schedule:
      interval: "weekly"
    open-pull-requests-limit: 100

  - package-ecosystem: "composer"
    commit-message:
      prefix: "deps(php)"
    directories:
      - dependencies/composer
    schedule:
      interval: "weekly"
    open-pull-requests-limit: 100
    groups:
      composer:
        applies-to: version-updates
        patterns:
          - squizlabs/php_codesniffer
          - phpstan/phpstan
          - vimeo/psalm