Coding standards

Changes to Drupal coding standards are proposed and discussed in issues in the Coding Standards project.

The Drupal coding standards apply to code within Drupal and its contributed modules. These standards are version-independent and "always-current".

All new code should follow the current standards, regardless of (core) version.

Existing code in older versions may be updated. For large code-bases (like Drupal core), updating the code of a previous version for the current standards may be too huge of a task.

Comments and names should use US English spelling.

Coding standard fixes are done by rule not individual files.

The video tutorial, Understanding the Drupal Coding Standards, explains the standards, why they are important, and how to use them.

Guide maintainers

pfrenssen's picture
effulgentsia's picture
realityloop's picture
tizzo's picture
jthorson's picture