Skip to content
This repository has been archived by the owner on Aug 9, 2022. It is now read-only.

Commit

Permalink
#1 Init QA bundles
Browse files Browse the repository at this point in the history
  • Loading branch information
mathieu-ducrot committed Jun 23, 2021
1 parent db1374f commit dd4202e
Show file tree
Hide file tree
Showing 5 changed files with 47 additions and 4 deletions.
5 changes: 5 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
/vendor/
composer.lock
/phpmetrics/
coverage.*
.php_cs.cache
38 changes: 38 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -21,3 +21,41 @@ ps: ## List containers from project
.PHONY: ssh
ssh: ## Access to the php container in interactive mode
docker exec -it --user=dev smartbooster-parameterbundle-php bash

##
## Qualimetry
## -------

.PHONY: cs checkstyle
cs: checkstyle
checkstyle: ## PHP Checkstyle
vendor/bin/phpcs --extensions=php -n --standard=PSR12 --report=full src tests

.PHONY: cb code-beautifier
cb: code-beautifier
code-beautifier: ## Code beautifier (Checkstyle fixer)
vendor/bin/phpcbf --extensions=php --standard=PSR12 src tests

.PHONY: lint-php
lint-php: ## Linter PHP
find src -type f -name "*.php" -exec php -l {} \;

.PHONY: composer-validate
composer-validate: ## Validate composer.json and composer.lock
composer validate composer.json

.PHONY: cpd
cpd: ## Copy paste detector
vendor/bin/phpcpd --fuzzy src

.PHONY: metrics
metrics: ## Build static analysis from the php in src. Repports available in ./phpmetrics/index.html
vendor/bin/phpmetrics --report-html=phpmetrics src

.PHONY: phpstan
phpstan: ## Launch PHP Static Analysis
vendor/bin/phpstan analyse src --level=6

.PHONY: qa qualimetry
qa: qualimetry ## Launch all qualimetry rules
qualimetry: checkstyle lint-php composer-validate metrics phpstan
8 changes: 4 additions & 4 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,11 @@
"homepage": "https://www.smartbooster.io"
}
],
"require": {

},
"require-dev": {

"squizlabs/php_codesniffer": "^3.6",
"sebastian/phpcpd": "^6.0",
"phpmetrics/phpmetrics": "^2.7",
"phpstan/phpstan": "^0.12.90"
},
"autoload": {
"psr-4": {
Expand Down
Empty file added src/.gitkeep
Empty file.
Empty file added tests/.gitkeep
Empty file.

0 comments on commit dd4202e

Please sign in to comment.