Skip to main content
drupalreleases

Use direct release data with your AI assistant.

Learn more

Drupal Code Quality

Security covered Under active development 4 sites

DCQ checks your Drupal code quality using git hooks, either locally before committing or remotely on the server to notify developers of issues. It utilizes tools like phpcs and the coder module to enforce Drupal coding standards and allows for configuration to ignore certain files or directories.

DCQ - Drupal Code Quality. Check code quality through git.

Installation and Usage

Requires phpcs and module coder

Installing local:
Copy pre-commit and pre-commit_dcq files from directory of module DCQ
to .git/hooks directory of your project, and add permission
"Allow run file as program" for these files.
The pre-commit_dcq script will analyse relevant committed files against the
Drupal coding standard and display errors and warnings.
In the event that you wish to commit your files regardless of the standards
errors do git commit --no-verify and git will not execute the pre-commit hooks

You can also look at this instruction https://drupal.org/node/2067677

You can use drush command from dcq module, for install precommit scripts on every new project

Installation remote:
Copy files from dcq_remote_scripts directory into your remote repository
.git/hooks/ directory. Also you can use symlinks for post-receive and
post-receive_dcq files.

post-receive hook will run every time you commit to remote repository.
He does not interrupt the process of adding files. It only checks them if it
finds errors, it sends an error report by e-mail specified in the settings of
the script. This is useful in cases where a senior developer controls the
quality of the code other developers on the project.

Script post-receive_dcq used on the remote repository, requires a mandatory
settings.

Ignoring the check code with using a configuration file:

You can ignore the check for files and folders (third-party modules or features.). See example on page of module settings.

File .dcq_ignore should be under version control, in order to make it work
for all developers. And to be able to use by hook post-receive for checking
on a remote server.

Troubleshooting:

To the git could run a scripts and hooks, you should set permissions for files
"Allow run file as program"

Useful links:
Eclipse formatter for Drupal Code Quality

Special thanks to bevanw for help in initial development.

Инструкция по установке DCQ на русском языке



Ask your assistant about Drupal Code Quality

Check compatibility with your Drupal and PHP version, maintenance and security coverage, from current release data. How it works

Depends on

Dependencies of the latest stable release

No dependencies recorded for this project.

Required by

Tracked projects that depend on this one

No tracked projects depend on this one yet.

Activity

Tracked releases
1
Tracked since
Mar 2023
Latest release
3 years ago
Releases (12 mo)
0
Maintenance
Dormant

Releases

Version Type Core PHP Release date
1.0.x-dev Dev Mar 6, 2023