150 likes | 268 Views
September 2011 Drupal@OSU Meetup. Agenda . Coder Module KMData Update from Jason Little Introductions & Open Discussion. What is Coder?. A Code Validation module for themes and Modules.
E N D
Agenda • Coder Module • KMData Update from Jason Little • Introductions & Open Discussion
What is Coder? • A Code Validation module for themes and Modules. • From the module page:"This module utilizes regular expressions to review source code files for code that 1) needs to change due to Drupal API changes and 2) does not satisfy Drupal coding standards."
What Else does coder check? • Doxygen compatible code & Drupal Coding Standards Compliance • Lightweight Security Warnings* • Upgrading between Drupal versions
The Module Listing Page • Code Review link on module listing page.
Coder Options • Conversion • Minor (Most)
What to review • Module or tHEME Selection • Include or Exclude file types
Results • Warnings • minor • normal • critical • List of warnings for each file with line numbers
Basic Errors/Warnings • Comment should be read "Implements hook_foo()." • String concatenation should be formatted with a space separating the operators (dot .) and the surrounding terms • There should be no trailing spaces • Use an indent of 2 spaces, with no tabs
Module Conversion • Info file should specify core=7.x • hook_perm() has been renamed to hook_permission(). (Drupal Docs) • hook_block has been split into a number of smaller hooks. (Drupal Docs) • Commits to the Git repository do not require the CVS $Id$ keyword in each file.
Security Warnings* • Potential problem: when FAPI element '#type' is set to 'markup' (default), '#value' only accepts filtered text, be sure to use check_plain(), filter_xss() or similar to ensure your $variable is fully sanitized.
? QUESTIONS?
What do you do with Themeing? • October Meetup - Planned Topic - Theming Basics • What are you doing that is out of the ordinary? • How many files are in your theme directory? • Do you use theme inheritance?