Skip to content

Saleor Core: the high performance, composable, headless commerce API.

Add graphql and migrations checks into pre-commit hooks

Alexey Pyltsyn6c3af3c4d246
diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml
index 5b48e4ad1f..03f25be7e0 100644
--- a/.pre-commit-config.yaml
+++ b/.pre-commit-config.yaml
@@ -34,3 +34,20 @@ repos:
- 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]