Home

Awesome

Integrity checker

Package allows to run static analysis on Magento 2 Module Packages to provide an integrity check of package.

Supported tools:

Standalone Installation

  1. Add your access token to auth.json (see how to create access token).
composer config --global --auth gitlab-token.gitlab.com {ACCESS_TOKEN}
  1. 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

  1. 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"}'
  1. Add your access token to auth.json (see how to create access token).
composer config --global --auth gitlab-token.gitlab.com {ACCESS_TOKEN}
  1. Change packages minimum stability to dev (required during development only.
composer config minimum-stability dev 
  1. 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