johnatas-x / angry-bearded
Code quality checking tools for Drupal 10/11 projects.
Installs: 4 016
Dependents: 0
Suggesters: 0
Security: 0
Stars: 4
Watchers: 1
Forks: 1
Open Issues: 1
Type:project
Requires
- php: >=8.3
- drupal/coder: 8.3.29
- ergebnis/composer-normalize: 2.47.0
- friendsoftwig/twigcs: 6.5.0
- johnatas-x/grumphp-phpa: 2.12.1
- johnatas-x/grumphp-phpdd: 2.12.1
- johnatas-x/phpcpd: 6.0.5
- maglnet/composer-require-checker: 4.16.1
- mglaman/phpstan-drupal: 2.0.5
- php-parallel-lint/php-parallel-lint: 1.4.0
- phpcompatibility/php-compatibility: dev-develop
- phpmd/phpmd: 2.15.0
- phpro/grumphp: 2.12.0
- phpstan/extension-installer: 1.4.3
- phpstan/phpstan: 2.1.14
- phpstan/phpstan-deprecation-rules: 2.0.2
- povils/phpmnd: 3.6.0
- slevomat/coding-standard: 8.18.0
- squizlabs/php_codesniffer: 3.13.0
- vincentlanglet/twig-cs-fixer: 3.6.0
Requires (Dev)
- roave/security-advisories: dev-latest
Suggests
- drupal/core-composer-scaffold: Scaffold relevant files in project root. Add johnatas-x/angry-bearded to extra.drupal-scaffold.allowed-packages.
- 2.3.14
- 2.3.13
- 2.3.12
- 2.3.11
- 2.3.10
- 2.3.9
- 2.3.8
- 2.3.7
- 2.3.6
- 2.3.5
- 2.3.4
- 2.3.3
- 2.3.2
- 2.3.1
- 2.3.0
- 2.2.7
- 2.2.6
- 2.2.5
- 2.2.4
- 2.2.3
- 2.2.2
- 2.2.1
- 2.2.0
- 2.1.1
- 2.1.0
- 2.0.1
- 2.0.0
- 1.7.0
- 1.6.1
- 1.6.0
- 1.5.3
- 1.5.2
- 1.5.1
- 1.5.0
- 1.4.3
- 1.4.2
- 1.4.1
- 1.4.0
- 1.3.2
- 1.3.1
- 1.3.0
- 1.2.0
- 1.1.5
- 1.1.4
- 1.1.3
- 1.1.2
- 1.1.1
- 1.1.0
- dev-main / 1.0.x-dev
- 1.0.3
- 1.0.2
- 1.0.1
- 1.0.0
- dev-renovate/squizlabs-php_codesniffer-3.x
This package is auto-updated.
Last update: 2025-05-11 06:35:11 UTC
README
This tool is a pre-configured GrumPHP for Drupal 10 & 11 projects.
The rules are intentionally strict — feel free to customize the .dist files to suit your needs.
A .editorconfig
file and a Qodana template are also included.
🔧 Included tools
- ComposerRequireChecker
- Drupal Coder
- PHP Assumptions (phpa)
- PHP Copy/Paste Detector (phpcpd)
- PHP Magic Number Detector (phpmnd)
- PHP Parallel Lint
- PHPMD
- PHPStan
- PHPStan Deprecation Rules
- PHPStan Extension Installer
- phpstan-drupal
- PHP_CodeSniffer
- PHP Compatibility Coding Standard for PHP CodeSniffer
- Slevomat Coding Standard
- PhpDeprecationDetector (phpdd)
- Twigcs
- Twig CS Fixer
- composer-normalize
🚀 Installation
Important
This tool is compatible with multiple versions of Drupal as well as multiple versions of PHP.
Choose the appropriate release for your situation using the table below:
Drupal 10 | Drupal 11 | Drupal 12 | |
---|---|---|---|
PHP 8.1 | 1.6.* |
NA | NA |
PHP 8.2 | 1.7.* |
NA | NA |
PHP 8.3 | 2.* |
2.* |
NA |
PHP 8.4 | 2.* |
2.* |
coming soon |
PHP 8.5 | coming soon | coming soon | coming soon |
➡️ When using drupal/core-composer-scaffold (recommended)
In most cases, you would already be using the drupal/core-composer-scaffold
package if you have set up using the latest Drupal templates. This package uses core-composer-scaffold
to set up configuration files in your project. To make this work, add this package name in your composer's extra.drupal-scaffold.allowed-packages
section.
"name": "my/project", ... "extra": { "drupal-scaffold": { "allowed-packages": [ "johnatas-x/angry-bearded" ], ... } }
Now, run composer require
to include the package in your application. Since the package is now allowed, the core-composer-scaffold
package will copy the configuration files.
# Replace "2.*" with your compatible release (see below). composer require --dev johnatas-x/angry-bearded:2.*
💡 More about scaffolding
As described before, this package uses drupal/core-composer-scaffold
plugin to scaffold a few files to the project root. While not strictly required, it’s likely already part of your setup if you're building a Drupal site.
The scaffolding process runs during every Composer operation and may overwrite files. Only the file grumphp.yml.dist
is not overwritten during later operations. If you are customizing any of the other configuration files and don't want the updates to overwrite your changes, you can override the behavior in your composer.json file. For example, to skip phpmd.xml.dist
from being overwritten, add this to your composer.json
:
"name": "my/project", ... "extra": { "drupal-scaffold": { "file-mapping": { "[project-root]/phpmd.xml.dist": false } } }
For more details, read the "Excluding Scaffold files" section of the documentation for the core-composer-scaffold plugin.
➡️ Without drupal/core-composer-scaffold
If you're not using the scaffolding plugin, the package won't automatically copy the configuration files.
First, run composer require
to include the package in your application.
# Replace "2.*" with your compatible release (see below). composer require --dev johnatas-x/angry-bearded:2.*
If you don't already have a grumphp.yml
file in your project, GrumPHP will prompt you to create one — select "No."
Then, copy all *.dist
files from the package to your project root. The files copied are:
- .editorconfig.dist
- grumphp.yml.dist
- phpcs.xml.dist
- phpmd.xml.dist
- phpstan.neon.dist
- phpstan-drupal.neon.dist
- qodana.yaml.dist
Note
For deprecated checks only with PHPStan Drupal, copy phpstan-drupal-deprecated.neon.dist
instead of both phpstan.neon.dist
and phpstan-drupal.neon.dist
.
Tip
To copy all files, you can run:
cp vendor/johnatas-x/angry-bearded/*.dist .
🚧 Usage
No additional setup is required. However, if Git hooks aren’t triggering, run: php ./vendor/bin/grumphp git:init
.
For additional commands, look at grumhp's documentation.
💈 Customising
- Most customizations start by copying the
grumphp.yml.dist
file to your project root. Make sure you have the file. - By default, the Drupal logo is used in successful outputs, but you can use GrumPHP's logo modifying
ascii
ingrumphp.yml
or using your own logo.
➕ Adding tasks
You can add and customize various tasks in your grumphp.yml
.
Read the online documentation for GrumPHP tasks to see the tasks you can use and configure.
🛂 Forcing commit message format
To configure the commit message structure, use the git_commit_message task. For example, to enforce the commit message contains the YouTrack issue ID, use the rule as the following snippet. More options are documented online.
# grumphp.yml grumphp: tasks: git_commit_message: matchers: Must contain issue number: /YouTrack #\d+/
🚫 Disable commit banners
GrumPHP supports banners to celebrate (or scold) on your commit. This is fun, but it is possible it gets on your nerves. If you don’t want it, edit the grumphp.yml file and replace the following parameters:
# grumphp.yml grumphp: ascii: ~
You could even disable specific ones like this:
# grumphp.yml grumphp: ascii: succeeded: ~