HAProxy

HAProxy coding style for contributions

  Mirror Sites: Master
  Language: English

Quick links

Quick News
Recent News
Introduction
Indentation
Alignment
Braces
Line breaks
Spaces
Parenthesis
NULL processing
Syscall returns
Declarations
Macros
Includes
Comments
Assembly
Contacts
Download
Documentation
Live demo
They use it!
Commercial Support
Products using HAProxy
Add-on features
Other Solutions
External links
Mailing list archives
10GbE load-balancing (updated)
Contributions
Known bugs

Web Based User Interface
HATop: Ncurses Interface


Willy TARREAU
You want to donate ?


visitors online
 
Web 1wt.eu



Introduction

A number of contributors are often embarrassed with coding style issues, they don't always know if they're doing it right, especially since the coding style has elvoved along the years. What is explained here is not necessarily what is applied in the code, but new code should as much as possible conform to this style. Coding style fixes happen when code is replaced. It is useless to send patches to fix coding style only, they will be rejected, unless they belong to a patch series which needs these fixes prior to get code changes. Also, please avoid fixing coding style in the same patches as functional changes, they make code review harder.

A good way to quickly validate your patch before submitting it is to pass it through the Linux kernel's checkpatch.pl utility which can be downloaded here :

Running it with the following options relaxes its checks to accommodate to the extra degree of freedom that is tolerated in HAProxy's coding style compared to the stricter style used in the kernel :
    checkpatch.pl --ignore=LEADING_SPACE,CODE_INDENT,DEEP_INDENTA