run_as_root / integrity-checker
Installs: 16 575
Dependents: 0
Suggesters: 0
Security: 0
Stars: 29
Watchers: 2
Forks: 2
Open Issues: 4
Type:project
Requires
- php: >=7.2.0
- ext-json: *
- ext-simplexml: *
README
Package allows to run static analysis on Magento 2 Module Packages to provide an integrity check of package.
Supported tools:
- 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.
Standalone Installation
- 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
Package Installation
- 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
Usage
Dependencies Checker
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.
Module Structure Checker
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