[meta] Automate the coding-standards part of patch review

Created on 5 October 2011, over 13 years ago
Updated 6 March 2025, about 15 hours ago

Problem/Motivation

A large portion of the time spent developing, reviewing, and revising patches centers around adherence to Drupal coding standards. Much of that effort could be shifted from human-brain-power to computing-power by integrating Coder review into the testing cycle.

Proposed resolution

  1. Integrate coder review into PIFR/PIFT so that patches which pass Simpletest are also subject to a coder review test.

    See: #1296790: Project_Dependency breaks Coder tests (patch ready)

  2. At least initially, the coder review should be included in test results but should not result in a status.

    See: #830838: Allow configurable "Advisory" reviews (patch ready - demo on rfay.redesign.devdrupal.org & qa.scratch.d.o)

  3. During this evaluation period, compare the coder review results with the human-brain reviews to evaluate and/or improve the performance of coder review.

    See: #1361508: [META] Tracking issue for Coder Advisory Review test issues

    This period should also be used to recruit or inspire more active maintainers for Coder.

  4. After the initial evaluation period, if it is deemed advisable to continue, the coder reports should be acted upon as follows:

  5. In this way, we will gradually find and eliminate differences between what Coder reports and what the current standards recommend or require.

  6. When the entire body of Drupal core can pass coder review with no errors, (or when that goal is within easy reach), the testbots should be re-programmed so that coder review affects the actual test result. Violations should result in a status.

    See: #1266446: Core-wide code style cleanup

    See: #1266444: DrupalCI should return failed for poor code style - php

Remaining tasks

So that we don't have a huge slew of patches, webchick suggested that we write a script to take care of the code style changes. Grammar Parser and Coder may help with this.

In addition, coder review has known problems that need to be addressed:

User interface changes

In addition to a functional test, patches will be subject to an additional coding-style test.

API changes

History

webchick posted in 📌 Clarify scope of PHP coding standards for core (major version) and contrib code Closed: outdated :

I become more and more convinced that discussions like this are a complete mis-use of time, energy, and focus, and we would all be far better off spending all of that effort on automating Coder module reviews for uploaded patches. Then we can put whatever behaviour we want *in code* and make sure it's consistently enforced across all projects.

🌱 Plan
Status

Active

Component

Policy

Created by

🇺🇸United States pillarsdotnet

Live updates comments and jobs are added and updated live.
  • Needs issue summary update

    Issue summaries save everyone time if they are kept up-to-date. See Update issue summary task instructions.

  • Coding standards

    It involves compliance with, or the content of coding standards. Requires broad community agreement.

Sign in to follow issues

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

Production build 0.71.5 2024