repos:
  - repo: https://github.com/ambv/black
    rev: 19.3b0
    hooks:
      - id: black
        language_version: python3

  - repo: https://github.com/pre-commit/pre-commit-hooks
    rev: v2.2.3
    hooks:
      - id: trailing-whitespace
      - id: end-of-file-fixer
      - id: flake8

  - repo: https://github.com/asottile/seed-isort-config
    rev: v1.9.2
    hooks:
      - id: seed-isort-config

  - repo: https://github.com/pre-commit/mirrors-isort
    rev: v4.3.21
    hooks:
      - id: isort

  - repo: https://github.com/pycqa/pydocstyle
    rev: 4.0.0
    hooks:
      - id: pydocstyle
        files: ^saleor/

  - repo: https://github.com/prettier/prettier
    rev: 1.18.2
    hooks:
      - id: prettier
        files: ^saleor/static/*.*\.js$
        verbose: true

repos:
  - repo: https://github.com/ambv/black
    rev: 19.3b0
    hooks:
      - id: black
        language_version: python3

  - repo: https://github.com/pre-commit/pre-commit-hooks
    rev: v2.2.3
    hooks:
      - id: trailing-whitespace
      - id: end-of-file-fixer
      - id: flake8

  - repo: https://github.com/asottile/seed-isort-config
    rev: v1.9.2
    hooks:
      - id: seed-isort-config

  - repo: https://github.com/pre-commit/mirrors-isort
    rev: v4.3.21
    hooks:
      - id: isort

  - repo: https://github.com/pycqa/pydocstyle
    rev: 4.0.0
    hooks:
      - id: pydocstyle
        files: ^saleor/

  - repo: https://github.com/prettier/prettier
    rev: 1.18.2
    hooks:
      - id: prettier
        files: ^saleor/static/*.*\.js$
        verbose: true

  - repo: local
    hooks:
      - id: migrations-check
        language: system
        name: Check for uncreated migrations.
        entry: bash -c "./manage.py makemigrations --check --dry-run"
        files: "models\\.py$"
        stages: [commit]

  - repo: local
    hooks:
      - id: gql-schema-check
        language: system
        name: Check for up-to-date GraphQL schema.
        entry: bash -c "./manage.py get_graphql_schema | diff saleor/graphql/schema.graphql -"
        stages: [commit]

Add graphql and migrations checks into pre-commit hooks
Add graphql and migrations checks into pre-commit hooks