diff --git a/Makefile b/Makefile deleted file mode 100644 index 8f9e7509..00000000 --- a/Makefile +++ /dev/null @@ -1,5 +0,0 @@ -include make/variables.mk -include make/help.mk -include make/composer.mk -include make/lint.mk -include make/build.mk diff --git a/composer.json b/composer.json index 41f2fc14..c0ba14b6 100644 --- a/composer.json +++ b/composer.json @@ -152,5 +152,11 @@ "Flasher\\SweetAlert\\Laravel\\FlasherSweetAlertServiceProvider" ] } + }, + "scripts": { + "check-syntax": "test `find ./src -iname \"*.php\" | xargs -n1 -P6 php -l | grep -Fv \"No syntax errors\" | wc -l` -eq 0", + "normalize-composer": "find src -name \"composer.json\" -exec composer normalize {} \\;", + "normalize-packs": "find packs -name \"composer.json\" -exec composer normalize {} \\;", + "validate-composer": "find src -name \"composer.json\" -exec composer validate --strict {} \\;" } } diff --git a/grumphp.yml b/grumphp.yml index 3e559d33..bd922638 100644 --- a/grumphp.yml +++ b/grumphp.yml @@ -1,7 +1,10 @@ grumphp: + ascii: ~ tasks: composer: ~ composer_normalize: ~ + composer_script: + script: check-syntax phpcsfixer: ~ jsonlint: ~ yamllint: ~ diff --git a/make/build.mk b/make/build.mk deleted file mode 100644 index ae7e51ec..00000000 --- a/make/build.mk +++ /dev/null @@ -1,8 +0,0 @@ -.PHONY: assets build - -## Download local assets from cdn -assets: - bin/assets - -# Build a new PHPFlasher version -build: lint assets diff --git a/make/composer.mk b/make/composer.mk deleted file mode 100644 index 2aa0b76c..00000000 --- a/make/composer.mk +++ /dev/null @@ -1,9 +0,0 @@ -.PHONY: install update - -## 🧙‍ Installs the project dependencies and assets -install: composer.lock - $(COMPOSER) install $(COMPOSER_ARGS) - -## Upgrades your dependencies to the latest version according to composer.json, and updates the composer.lock file. -update: - $(COMPOSER) update --lock $(COMPOSER_ARGS) diff --git a/make/help.mk b/make/help.mk deleted file mode 100644 index 36f3c58e..00000000 --- a/make/help.mk +++ /dev/null @@ -1,27 +0,0 @@ -.PHONY: help - -COLOR_RESET = \033[0m -COLOR_INFO = \033[32m -COLOR_COMMENT = \033[33m - -## Help -help: - @printf "${COLOR_COMMENT}Usage:${COLOR_RESET}\n" - @printf " make [target]\n\n" - @printf "${COLOR_COMMENT}Available targets:${COLOR_RESET}\n" - @awk '/^[a-zA-Z\-\_0-9\.@]+:/ { \ - helpMessage = match(lastLine, /^## (.*)/); \ - if (helpMessage) { \ - helpCommand = substr($$1, 0, index($$1, ":")); \ - helpMessage = substr(lastLine, RSTART + 3, RLENGTH); \ - printf " ${COLOR_INFO}%-16s${COLOR_RESET} %s\n", helpCommand, helpMessage; \ - } \ - } \ - { lastLine = $$0 }' $(MAKEFILE_LIST) - -check_defined = \ - $(strip $(foreach 1,$1, \ - $(call __check_defined,$1,$(strip $(value 2))))) -__check_defined = \ - $(if $(value $1),, \ - $(error Undefined $1$(if $2, ($2)))) diff --git a/make/lint.mk b/make/lint.mk deleted file mode 100644 index af1a0e5f..00000000 --- a/make/lint.mk +++ /dev/null @@ -1,15 +0,0 @@ -.PHONY: lint fix - -## Run code style, linters -lint: - test `find ./src -iname "*.php" | xargs -n1 -P6 php -l | grep -Fv "No syntax errors" | wc -l` -eq 0 - $(PHP_CS_FIXER) fix --diff --dry-run -v - $(COMPOSER) normalize - find src -name "composer.json" -exec $(COMPOSER) normalize {} \; - $(COMPOSER) validate --strict - find src -name "composer.json" -exec $(COMPOSER) validate --strict {} \; - find packs -name "composer.json" -exec $(COMPOSER) normalize {} \; - -## Fix files with php-cs-fixer -fix: - $(PHP_CS_FIXER) fix --allow-risky=yes diff --git a/make/variables.mk b/make/variables.mk deleted file mode 100644 index 1feb946d..00000000 --- a/make/variables.mk +++ /dev/null @@ -1,12 +0,0 @@ -# Executables -EXEC_PHP = php -COMPOSER = composer - -# Parameters -COMPOSER_ARGS ?= - -# Executables: vendors -PHP_CS_FIXER = ./vendor/bin/php-cs-fixer - -# Misc -.DEFAULT_GOAL = help