Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/drupal-spider/drupalsecurity
PHP code sniffer plugin for Drupal code security audit.
https://github.com/drupal-spider/drupalsecurity
drupal php-codesniffer phpcs security security-audit security-scan security-scanner security-testing
Last synced: 3 months ago
JSON representation
PHP code sniffer plugin for Drupal code security audit.
- Host: GitHub
- URL: https://github.com/drupal-spider/drupalsecurity
- Owner: drupal-spider
- Created: 2022-09-27T08:54:00.000Z (over 2 years ago)
- Default Branch: 1.x-master
- Last Pushed: 2024-04-06T22:41:13.000Z (10 months ago)
- Last Synced: 2024-11-09T15:04:45.391Z (3 months ago)
- Topics: drupal, php-codesniffer, phpcs, security, security-audit, security-scan, security-scanner, security-testing
- Language: PHP
- Homepage:
- Size: 35.2 KB
- Stars: 1
- Watchers: 1
- Forks: 2
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
Awesome Lists containing this project
README
# DrupalSecurity
DrupalSecurity is a library for automated Drupal code security reviews. It
defines rules for [PHP_CodeSniffer](https://github.com/squizlabs/PHP_CodeSniffer)Note that Javascript has not been supported yet. To check and fix Javascript files
please use [ESLint](http://eslint.org/) and see the
[Drupal ESLint](https://www.drupal.org/node/1955232) documentation.## Global installation
First, install phpcs:
[PHP_CodeSniffe install](https://github.com/PHPCSStandards/PHP_CodeSniffer/?tab=readme-ov-file#installation)
To make the `phpcs` command available globally, add the Composer
bin path to your `$PATH` variable in `~/.profile`, `~/.bashrc` or `~/.zshrc`:export PATH="$PATH:$HOME/.composer/vendor/bin"
Second, install PHPCS plugins:
[Drupal coder](https://github.com/drupalprojects/coder#installation)
[PHPCSUtils](https://github.com/PHPCSStandards/PHPCSUtils)Last, download the DrupalSecurity folder to your local
## Usage
Check Drupal Security standards
phpcs --standard=/path/to/DrupalSecurity --extensions=php,module,inc,install,theme,yml,twig /file/to/drupal/module