SlideShare a Scribd company logo
PHP Unconference 09



                Thomas Weinert
Practical Experiences With Pre-Commit Hooks
About Me
●   Application Developer
    –   PHP
    –   XSLT/XPath
    –   Javascript
●   papaya CMS
    –   PHP based Content Management System
    –   uses XSLT for Templates
SVN Hooks
●   Shell scripts on server
●   For each repository
●   Several events
        –   Pre-/Post-Commit
Pre-Commit
●   Before Commit
●   Transaction
●   Standard error goes to SVN client
●   Return value != 0 blocks commit
PHPCodeSniffer
●   Ensure coding style
●   Block parse errors (Lint)
●   Ensure licence infos
Reaction
●   Anger
●   Acceptance
●   Happyness
●   Request for more sniffs
       –   Rules that are not checked are ignored
SVNLook
–   On repository
–   Read only
–   Revision or transaction
papaya Custom Hook
●   Calls PHPCodeSniffer only once
●   Streamwrapper for SVNLook
●   Uses XML response
●   Outputs detailed error informations for each file
●   Exclude: */external/*
Screenshot: Coding Style Error
Parse Error Sniff
●   php -l
●   ext/pcntl
●   Input/output streams
Screenshot: Parse Error
Commit Message Check
●   Kore Nordmann for Arbit(Tracker)
●   Connect revision control system to bug tracker
●   Readability
●   Can not check contents
Screenshot: Bad Message
Rules
●   - keyword (ticket): description
●   # comment
●   Maximum line length
Sample
Reactions
●   Rejection and acceptance
●   Syntax flame war
●   Keyword flame war
●   Line break flame war
●   Increasing quality
Result
●   Two additional keywords for documentation
    team
●   Line break suggestions
Screenshot: Fisheye
Mantis
●   1.1
          –   Several commit hooks for actions in Mantis
          –   Commits as comments
●   1.2
          –   Source browser plugin (WebSVN)
          –   Connects change sets to tickets
Screenshot: Mantis 1.2

More Related Content

PDF
Rails hosting
PPTX
Websocket
PDF
Web Sockets - HTML5
PDF
Embedding GlassFish v3 in Ehcache Server
PDF
Introduction to Web Sockets
PDF
XMPP & AMQP
PPT
WebSockets and Java
PPTX
Web Sockets
Rails hosting
Websocket
Web Sockets - HTML5
Embedding GlassFish v3 in Ehcache Server
Introduction to Web Sockets
XMPP & AMQP
WebSockets and Java
Web Sockets

What's hot (20)

PDF
Http caching 101 and a bit of CacheCow
ODP
Rabbit mq, amqp and php
PPTX
AHA-best-msf-interface-ever
PPTX
WebSockets Everywhere: the Future Transport Protocol for Everything (Almost)
PPTX
Websockets
PPTX
Writing services in Ballerina_Ballerina Day CMB 2018
PDF
QCon 2017 - Java/JVM com Docker em produção: lições das trincheiras
PDF
PPTX
Getting the most out of WebPageTest
PDF
Altitude SF 2017: QUIC - A low-latency secure transport for HTTP
KEY
$PENK->{'YAPC::Tiny'};
PPTX
ZeroMQ: Super Sockets - by J2 Labs
PDF
Magento 2 performance - a benchmark
PDF
Real life XMPP Instant Messaging
PDF
MMS Automation In Action!
PDF
Understanding HTTP & Web Performance
PPT
Cometdの紹介
PDF
From One to a Cluster
PPTX
How to Install and Use MMS
PPTX
Techniques to Improve Cache Speed
Http caching 101 and a bit of CacheCow
Rabbit mq, amqp and php
AHA-best-msf-interface-ever
WebSockets Everywhere: the Future Transport Protocol for Everything (Almost)
Websockets
Writing services in Ballerina_Ballerina Day CMB 2018
QCon 2017 - Java/JVM com Docker em produção: lições das trincheiras
Getting the most out of WebPageTest
Altitude SF 2017: QUIC - A low-latency secure transport for HTTP
$PENK->{'YAPC::Tiny'};
ZeroMQ: Super Sockets - by J2 Labs
Magento 2 performance - a benchmark
Real life XMPP Instant Messaging
MMS Automation In Action!
Understanding HTTP & Web Performance
Cometdの紹介
From One to a Cluster
How to Install and Use MMS
Techniques to Improve Cache Speed
Ad

Viewers also liked (20)

PDF
CBSib Core Pitch Module 1
PPT
Classification
PPT
Mobile App Development Made Easy
PDF
PPTX
Trababajo de computacion
PPTX
Social service2
PDF
Migrando a gravação SMF do modo VSAM para Logstream por Jorge Areias
PPT
Rocioepablo
PPTX
Generaciondes de la tecnologia educativa
PPS
Back injury prevention
PPS
PDF
31413 ca wily soa mgr pb ptb
PPTX
REPARACIÓN GRIETAS PISCINA
DOC
Capacity Planning para Ambiente Distribuído, por Marcelo Otto
PPTX
Os generais
ODP
Xosé cañizo
PPTX
CORRIDOS PROHIBIDOS
PPT
PDF
Clase storyboard
CBSib Core Pitch Module 1
Classification
Mobile App Development Made Easy
Trababajo de computacion
Social service2
Migrando a gravação SMF do modo VSAM para Logstream por Jorge Areias
Rocioepablo
Generaciondes de la tecnologia educativa
Back injury prevention
31413 ca wily soa mgr pb ptb
REPARACIÓN GRIETAS PISCINA
Capacity Planning para Ambiente Distribuído, por Marcelo Otto
Os generais
Xosé cañizo
CORRIDOS PROHIBIDOS
Clase storyboard
Ad

Similar to Experiences With Pre Commit Hooks (20)

PDF
SVN Hook
PDF
Workshop quality assurance for php projects - phpbelfast
PDF
Workshop quality assurance for php projects - ZendCon 2013
ODP
PHP Quality Assurance Workshop PHPBenelux
ODP
Practical SVN for PHP Developers
PDF
Commit Hooks: the Subtle Hammer
PDF
Building and Deploying PHP Apps Using phing
PDF
Debugging: Rules And Tools - PHPTek 11 Version
PDF
Joomla Code Quality Control and Automation Testing
PPTX
Reducing Bugs With Static Code Analysis php tek 2025
PDF
Continuous Quality Assurance
PPTX
Static Code Analysis PHP[tek] 2023
PDF
PHPCon China 2018 - 好孩子的 PHP 撰碼指南
KEY
Workshop quality assurance for php projects tek12
PPT
Build Automation of PHP Applications
KEY
Version control with subversion
PDF
Debugging: Rules & Tools
PDF
Workshop quality assurance for php projects - phpdublin
PDF
Quality Assurance for PHP projects - ZendCon 2012
PDF
Ln monitoring repositories
SVN Hook
Workshop quality assurance for php projects - phpbelfast
Workshop quality assurance for php projects - ZendCon 2013
PHP Quality Assurance Workshop PHPBenelux
Practical SVN for PHP Developers
Commit Hooks: the Subtle Hammer
Building and Deploying PHP Apps Using phing
Debugging: Rules And Tools - PHPTek 11 Version
Joomla Code Quality Control and Automation Testing
Reducing Bugs With Static Code Analysis php tek 2025
Continuous Quality Assurance
Static Code Analysis PHP[tek] 2023
PHPCon China 2018 - 好孩子的 PHP 撰碼指南
Workshop quality assurance for php projects tek12
Build Automation of PHP Applications
Version control with subversion
Debugging: Rules & Tools
Workshop quality assurance for php projects - phpdublin
Quality Assurance for PHP projects - ZendCon 2012
Ln monitoring repositories

More from Thomas Weinert (13)

PDF
PHPUG CGN: Controlling Arduino With PHP
PDF
Controlling Arduino With PHP
PDF
Decoupling Objects With Standard Interfaces
PDF
Asynchronous I/O in PHP
PDF
Lumberjack XPath 101
PDF
FluentDom
PDF
Optimizing Your Frontend Performance
PDF
The Lumber Mill - XSLT For Your Templates
PDF
The Lumber Mill Xslt For Your Templates
PDF
Deliver Files With PHP
PDF
Optimizing Your Frontend Performance
PDF
PHP 5.3/6
PDF
Optimizing Your Frontend Performance
PHPUG CGN: Controlling Arduino With PHP
Controlling Arduino With PHP
Decoupling Objects With Standard Interfaces
Asynchronous I/O in PHP
Lumberjack XPath 101
FluentDom
Optimizing Your Frontend Performance
The Lumber Mill - XSLT For Your Templates
The Lumber Mill Xslt For Your Templates
Deliver Files With PHP
Optimizing Your Frontend Performance
PHP 5.3/6
Optimizing Your Frontend Performance

Recently uploaded (20)

PPTX
Digital-Transformation-Roadmap-for-Companies.pptx
PPT
“AI and Expert System Decision Support & Business Intelligence Systems”
PDF
Bridging biosciences and deep learning for revolutionary discoveries: a compr...
DOCX
The AUB Centre for AI in Media Proposal.docx
PDF
cuic standard and advanced reporting.pdf
PDF
KodekX | Application Modernization Development
PDF
Build a system with the filesystem maintained by OSTree @ COSCUP 2025
PDF
Advanced methodologies resolving dimensionality complications for autism neur...
PDF
Empathic Computing: Creating Shared Understanding
PDF
Reach Out and Touch Someone: Haptics and Empathic Computing
PDF
Spectral efficient network and resource selection model in 5G networks
PDF
7 ChatGPT Prompts to Help You Define Your Ideal Customer Profile.pdf
PDF
TokAI - TikTok AI Agent : The First AI Application That Analyzes 10,000+ Vira...
PPTX
Understanding_Digital_Forensics_Presentation.pptx
PPTX
Effective Security Operations Center (SOC) A Modern, Strategic, and Threat-In...
PPTX
KOM of Painting work and Equipment Insulation REV00 update 25-dec.pptx
PPTX
20250228 LYD VKU AI Blended-Learning.pptx
PDF
Per capita expenditure prediction using model stacking based on satellite ima...
PDF
Review of recent advances in non-invasive hemoglobin estimation
PPTX
VMware vSphere Foundation How to Sell Presentation-Ver1.4-2-14-2024.pptx
Digital-Transformation-Roadmap-for-Companies.pptx
“AI and Expert System Decision Support & Business Intelligence Systems”
Bridging biosciences and deep learning for revolutionary discoveries: a compr...
The AUB Centre for AI in Media Proposal.docx
cuic standard and advanced reporting.pdf
KodekX | Application Modernization Development
Build a system with the filesystem maintained by OSTree @ COSCUP 2025
Advanced methodologies resolving dimensionality complications for autism neur...
Empathic Computing: Creating Shared Understanding
Reach Out and Touch Someone: Haptics and Empathic Computing
Spectral efficient network and resource selection model in 5G networks
7 ChatGPT Prompts to Help You Define Your Ideal Customer Profile.pdf
TokAI - TikTok AI Agent : The First AI Application That Analyzes 10,000+ Vira...
Understanding_Digital_Forensics_Presentation.pptx
Effective Security Operations Center (SOC) A Modern, Strategic, and Threat-In...
KOM of Painting work and Equipment Insulation REV00 update 25-dec.pptx
20250228 LYD VKU AI Blended-Learning.pptx
Per capita expenditure prediction using model stacking based on satellite ima...
Review of recent advances in non-invasive hemoglobin estimation
VMware vSphere Foundation How to Sell Presentation-Ver1.4-2-14-2024.pptx

Experiences With Pre Commit Hooks

  • 1. PHP Unconference 09 Thomas Weinert Practical Experiences With Pre-Commit Hooks
  • 2. About Me ● Application Developer – PHP – XSLT/XPath – Javascript ● papaya CMS – PHP based Content Management System – uses XSLT for Templates
  • 3. SVN Hooks ● Shell scripts on server ● For each repository ● Several events – Pre-/Post-Commit
  • 4. Pre-Commit ● Before Commit ● Transaction ● Standard error goes to SVN client ● Return value != 0 blocks commit
  • 5. PHPCodeSniffer ● Ensure coding style ● Block parse errors (Lint) ● Ensure licence infos
  • 6. Reaction ● Anger ● Acceptance ● Happyness ● Request for more sniffs – Rules that are not checked are ignored
  • 7. SVNLook – On repository – Read only – Revision or transaction
  • 8. papaya Custom Hook ● Calls PHPCodeSniffer only once ● Streamwrapper for SVNLook ● Uses XML response ● Outputs detailed error informations for each file ● Exclude: */external/*
  • 10. Parse Error Sniff ● php -l ● ext/pcntl ● Input/output streams
  • 12. Commit Message Check ● Kore Nordmann for Arbit(Tracker) ● Connect revision control system to bug tracker ● Readability ● Can not check contents
  • 14. Rules ● - keyword (ticket): description ● # comment ● Maximum line length
  • 16. Reactions ● Rejection and acceptance ● Syntax flame war ● Keyword flame war ● Line break flame war ● Increasing quality
  • 17. Result ● Two additional keywords for documentation team ● Line break suggestions
  • 19. Mantis ● 1.1 – Several commit hooks for actions in Mantis – Commits as comments ● 1.2 – Source browser plugin (WebSVN) – Connects change sets to tickets