Download the PHP package burdamagazinorg/thunder-dev-tools without Composer
On this page you can find all versions of the php package burdamagazinorg/thunder-dev-tools. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download burdamagazinorg/thunder-dev-tools
More information about burdamagazinorg/thunder-dev-tools
Files in burdamagazinorg/thunder-dev-tools
Package thunder-dev-tools
Short Description Developer tools for Thunder distribution
License GPL-2.0+
Informations about the package thunder-dev-tools
Thunder Development Tools
Code Style Guidelines
Thunder code style guidelines are in agreement with Drupal code styles. For general validation of files is used Drupal Coder. More detailed validation of JavaScript code is made by ESLint with predefined Drupal settings.
Drupal Coder
In order that Drupal Coder works, following steps should be executed.
- Install Composer (* this step can be skipped if composer already exists on system)
- Please follow guide on official page
- Install Drupal/Coder in global Composer directory
- Please follow installation guide on Packagist
Usage from command line:
Additionally both commands can be used with option for checking defined Drupal best practices.
ESLint
In order that ESLint works, following steps should be executed
- Install Node.js (* this step can be skipped if Node.js already exists on system)
- Official guide from Node.js page should be followed
- Install ESLint
Usage from command line:
Thunder Guidelines Checker
This script is provided by Thunder Development Tools. It's wrapper for phpcs and eslint tools.
To initialize project with requirements execute:
Please take in consideration that path could be customized in your root composer.json file.
Then some basic options for checking of code style guidelines can be used:
For example to check and correct php and javascript files with auto correction:
Integrate Code Style checking in PHPStorm
Drupal Coder
- In PHPStorm preferences search for:
- Select option
- Open configuration dialog by pressing edit button [...]
- In Configuration dialog add new configuration or edit existing Local. Set correct path for phpcs by pressing edit button [...]. Path should be: and save that settings for Code Sniffer
- To configure usage of PHP Code Sniffer select
- Option PHP Code Sniffer validation should already be filtered by Search. Enable that option.
- And for that validation procedure change Coding standard option to Drupal. (* sometimes PHPStorm doesn't recognize that coding standard has been changed if Drupal is preselected. It's sufficient just to select other coding standard and then put back to Drupal)
After these settings are saved in PHPStorm warnings with prefix phpcs: will be displayed in editor.
ESLint
- In PHPStorm preferences search for:
- Select option
- Enable it
Default settings can be preserved. ESLint will automatically search for installed command and also coding style configuration files from project will be used.
Git Hooks
Git Pre Commit Hook
To check is code valid before commit, git pre commit hook can be used with execution of thunder guideline checker script. Create script file in your project folder, with following content:
Make sure that the file is executable. That will automatically validate files before commit and display possible problems and additionally commit will not be executed unless everything is correct and valid.