Package allows to run static analysis on Magento 2 Module Packages to provide an integrity check of package.
- Composer.json package dependencies checker - check *.xml, *.js, *.php and *.phtml on a subject if other packages used inside and check if corresponding module/package is declared as required in composer.json.
- Module.xml dependencies checker - analyse if packages' etc/module.xml file contains in 'sequence' section all Magento 2 modules which classes are used in *.xml, *.js, *.php and *.phtml files of the package.
- Package structure checker - verify if all newly added Magento 2 modules has a proper structure with all required files.
- Add your access token to auth.json (see how to create access token).
composer config --global --auth gitlab-token.gitlab.com {ACCESS_TOKEN}
- Install project from gitlab repository
composer create-project run_as_root/integrity-checker --repository-url="{\"type\": \"vcs\", \"url\": \"git@gitlab.com:oleksandr.kravchuk1/integrity-checker.git\"}" -s dev integrity-checker dev-development --remove-vcs
- Add Gitlab repository to list of available repositories for your project composer.json
composer config repositories.integrity-checker '{"type": "vcs", "url": "git@gitlab.com:oleksandr.kravchuk1/integrity-checker.git"}'
- Add your access token to auth.json (see how to create access token).
composer config --global --auth gitlab-token.gitlab.com {ACCESS_TOKEN}
- Change packages minimum stability to
dev
(required during development only.
composer config minimum-stability dev
- Install package via composer
composer require --dev run_as_root/integrity-checker dev-development
bin/dependencies {magento root} {folder} {folder2} {folder3}
{magento root} - path to Magento 2 project root directory. Tool require composer.lock to be defined. All packages inside {folder}'s will be recognized by composer.json file. {folder} - expected to be relative inside the magento root folder. Dependencies check will be run for composer.json and etc/module.xml together.
bin/structure {magento root} {folder} {folder2} {folder3}
{magento root} - path to Magento 2 project root directory. Tool collects all packages in {folder} by registration.php files. For each module it compares current structure with Standard structure and print diff, if Standard structure was not followed.
Standard package structure:
docs
src
etc
module.xml
README.md
composer.json
registration.php