diff --git a/Makefile b/Makefile index 33ad3c0e6..34ebd23c1 100644 --- a/Makefile +++ b/Makefile @@ -1,7 +1,7 @@ # Add utility functions and scripts to the container include scripts/makefile/*.mk -.PHONY: all provision si exec exec0 down clean dev info phpcs phpcbf drush check +.PHONY: all provision si exec exec0 down clean dev info phpcs phpcbf drush cinsp .DEFAULT_GOAL := help # https://stackoverflow.com/a/6273809/1826109 @@ -150,3 +150,12 @@ phpcs: ## Fix codebase according to Drupal standards https://www.drupal.org/docs/develop/standards phpcbf: @$(call phpcsexec, phpcbf) + +cinsp: + @echo "Config schema validation..." + @$(call php, drush -y en config_inspector) + @$(eval SCHEMA_ERRORS = $(shell docker-compose exec -T --user $(CUID):$(CGID) php drush inspect_config --only-error)) + @$(call php, drush -y pmu config_inspector) + @if [ ! -z "$(SCHEMA_ERRORS)" ]; then echo "Error(s) in config schemas"; exit 1; fi + +insp: | cinsp phpcs diff --git a/composer.json b/composer.json index 7cb9b737d..a08f33df6 100644 --- a/composer.json +++ b/composer.json @@ -34,6 +34,7 @@ "drupal-composer/drupal-scaffold": "^2.5", "drupal/admin_toolbar": "^1", "drupal/components": "^1", + "drupal/config_inspector": "^1.0@beta", "drupal/config_installer": "^1", "drupal/core": "^8.6.7", "drupal/default_content": "^1",