Coding standards

Events happening in the community are now at Drupal community events on www.drupal.org.
This group should probably have more organizers. See documentation on this recommendation.

This group is dedicated to optimizing performance of Drupal with coding standards. As such it deals with particular coding guidelines, sharing knowledge and benchmarks that might be integrated into Coder module.

If you are seeking help on high performance/scalability Drupal sites and how to gain a better performance for them, you might have a look at the High Performance group.

Guidelines
  • Each coding standard gets its own Wiki page including
    • a one line synopsis in the format XY is faster than YX
    • a proper description of how it improves performance
    • benchmarks from different platforms and PHP versions
    • web links to references and additional resources
  • You may
    • suggest new optimizations by posting a story
    • comment on new optimization proposals with insightful input
    • perform benchmarks on your platform(s) for existing and new optimizations

Coder Drupal 8.x Battleplan

Posted by douggreen on September 27, 2013 at 1:10pm

(Cross posted from http://drupal.org/node/2099351 because Angie said I could/should. This isn't a core issue, but it's an upgrade to D8 issue. We are talking about tackling automatic code upgrades.)

If the community agrees with the plan. It will be a few weeks or a more before I'm ready to ask people to write upgrades. But before we get there, in general, does this sound like a good plan or not? Please provide feedback on the d.o issue http://drupal.org/node/2099351.

Summary:

Read more

Giving the site administrator the full picture

Posted by manObject on April 13, 2012 at 7:51pm

A module, by definition, adds a feature to a Drupal installation. A well written module often provides administrative touches such as the ability to 'hide' the feature from certain user roles or because of a particular site configuration.
This is all well and good, but a problem can arise for the administrator when testing, if the module supplying the feature fails to supply some kind of visual feedback to indicate when it is in 'feature hiding' mode.

Read more

Create cookie naming standards

Posted by rwohleb on April 4, 2012 at 9:14pm

There are a handful of modules that set extra cookies to accomplish various things outside of the session. Some of them are used only on the client side and the server never needs to see them. Some of them are actually used on the server side. See:
https://wiki.fourkitchens.com/display/PF/Modules+that+break+caching,+and...

Read more

Standard needed for what is a "disruptive" patch

Posted by pillarsdotnet on October 3, 2011 at 6:25pm

<

dl>

Posted by jhodgdon on October 3, 2011 at 5:26pm
Coming from http://drupal.org/node/1295500#comment-5068622

There is frustration among new developers about how to make issues and patches that cause a minimum of disruption and a maximum of ease for reviewers/committers.

So we need to make a page explaining this. Suggested outline is on the above comment, and suggested place to put it is either:
http://drupal.org/patch
or
http://drupal.org/patch/review

Read more

Clarify scope of PHP coding standards for core (major version) and contrib code

Posted by pillarsdotnet on October 1, 2011 at 10:20pm

Posted by sun on October 1, 2011 at 8:09pm:

Problem

  • Uncertainty about when or how to apply coding standards across Drupal core versions and core vs. contrib code.

Goal

  • Clarify the scope of coding standards with regard to:

    1. major versions of core
    2. core vs. contrib code
  • Explicitly specify/state which particular coding standards have been different for earlier versions.

Read more

Define basic conventions for converting things to classes

Posted by catch on August 31, 2011 at 11:39am

As we move to converting low level system in core to classes, we need to define a convention for doing so.

Please chime in on the discussion at http://drupal.org/node/1239644.

Read more

Recommended Markup Guide for Modules

Posted by mlncn on March 20, 2011 at 3:27pm

I'm referencing the Drupal Markup Style Guide g.d.o wiki in the Definitive Guide to Drupal 7 and it hasn't been updated in a couple years so i wanted to give all interested parties, especially HTML5 folk, foreknowledge to update it (or link it to a d.o equivalent?).

Advice is sound and it's the most comprehensive take i've seen from a module developer's perspective, so that's why i'm providing the link: http://groups.drupal.org/node/6355

Read more

New commit message format

Posted by salvis on February 22, 2011 at 10:20pm

Apparently, Git doesn't like commit messages that start with a pound sign, which leads us to define a new standard format for commit messages.

Read more

Core Conversations on documentation at DrupalCon?

Posted by arianek on January 12, 2011 at 3:17am

Hey all -

DrupalCon Chicago's Core Conversation proposals need to be in by next Friday. Jennifer (jhodgdon) and I have been pondering whether and what might make a good topic or two to pitch.

Please post with ideas and whether you'd be interested in attending a docs focused session, it'll help us gear our proposal towards something everyone will be interested in!

Thanks!

Read more

Contributed Module Code Reviews

Posted by bonobo on December 29, 2010 at 7:25pm
Last updated by ccardea on Sat, 2011年04月30日 22:17

Code review of existing contributed modules is frequently cited as a means to improving the quality of existing contributed modules. However, the task of performing a code review falls somewhere between documentation, writing and reviewing patches, reviewing CVS applications, and creating new modules.

This is a proposal to elevate the visibility of module review, and make it easier for newcomers to perform module reviews.

Read more

Package names for contributed modules (Drupal 7)

Posted by mlncn on October 4, 2010 at 3:02pm
Last updated by mlncn on Wed, 2019年10月16日 19:20

Modules are grouped on the module administration page (admin/modules in Drupal 7) by package, which is defined, optionally, in our module's .info file. Package, then, is the most visible way in which modules are categorized. This wiki page documents package names chosen by module maintainers, please edit it!

Read more
Categories:

Should the docs style guide apply to interface text?

Posted by arianek on September 15, 2010 at 8:05pm

A ping in #drupal-docs earlier has brought to my attention that the Docs style guide only applies to handbook and not explicitly to interface text in Drupal core/contrib.

I'd think it should apply so we get consistent text and grammar formatting Drupal-wide, but didn't want to make such a sweeping declaration without some consensus from the community at large.

Read more

Standards for documenting implementations of theme functions

Posted by rstamm on May 19, 2010 at 4:06pm

We don't have a standard doc header for implementations of themeable functions like THEME_process_HOOK and theme_breadcrumb.

my suggestion:

/**
* Implements THEME_process_HOOK().
*/
function garland_process_page(&$variables) {
//...
/**
* Implements theme_breadcrumb().
*/
function garland_breadcrumb($variables) {
//...

or

/**
* Overrides theme_breadcrumb().
*/
function garland_breadcrumb($variables) {
//...
Read more

Standards for documenting theme functions

Posted by jhodgdon on February 23, 2010 at 3:55pm

A new issue: http://drupal.org/node/716496

There is a discussion there about how to standardize the doc header for default theme implementation functions, such as theme_table(). Please respond there if you are interested. Thanks!

Read more

Standards for documenting classes and interfaces

Posted by jhodgdon on February 22, 2010 at 3:58pm

There's a discussion going on about standards for documenting classes and interfaces in the Drupal API -- please comment on the issue (and NOT here) if interested:
http://drupal.org/node/718596

Read more

Ban global variable names for temporary tasks

Posted by miro_dietiker on January 30, 2010 at 10:17pm

I'd strongly recommend to add a directive in coding standards to ban common (global) variable names for temporary tasks.

This is a very important security issue as it can lead to certain accidental variable overwrites such as:

In context of a $node some code tries to load assigned user object and does $user = user_load($node->nid);
While this feels pretty OK for the first second one single global $user before this line will lead to a user context switch and thus permission takeover.
This is a very common mistake i've seen many times - and which happens too soon...

Read more

Concept: Architectural standard

Posted by casey on January 28, 2010 at 8:02pm
Last updated by casey on Thu, 2011年02月03日 21:48

A experimental document on an architectural standard.

Read more
Categories:

Only variables should be passed by reference

Posted by mfb on September 19, 2009 at 8:56pm

As you know if you've fiddled with PHP's error_reporting setting, Drupal 7 is not yet E_STRICT compliant. E_STRICT compliance is a good idea for forward compatibility (PHP 5.3 and 6.0) and also helpful for servers that already log E_STRICT errors.

Read more
1 comment Categories:

Drupal Code +Test Sprint Beginners Guide

Posted by Chris Charlton on August 15, 2009 at 10:22pm
Last updated by greggles on Wed, 2010年03月31日 16:06

THIS WIKI PAGE IS A WORK IN PROGRESS

In helping with LA Drupal's D7 Code+Test Sprint event, I noticed there's some easy points that help newbies feel progressive. There are many ways to help at a Code+Test sprint, and here are the ways that helped us in Los Angeles.

  • Make sure you have a Drupal.org account, with "Contributor links" turned on in your profile. This will expose a sidebar block linking to areas of interest for contributors. For example: "Patches to review (D7)" is what most people click on to find patches needing review.
Read more
Categories:
Subscribe with RSS Syndicate content

Coding standards

Group organizers

Group categories

Status

Group notifications

This group offers an RSS feed. Or subscribe to these personalized, sitewide feeds:

AltStyle によって変換されたページ (->オリジナル) /