CodingGuidelines 1.79 KB
Newer Older
1
2
Coding Guidelines
=================
3
4
5
6
7

DISCLAIMER: We realise the code doesn't necessarily follow all the rules.
This is an attempt to establish a standard coding style for future
development.

8
9
10
Coding style
------------

11
12
13
14
15
16
17
Column width: 79 columns or less within reason.

Indentation: tabs (standard eight column width)
Please don't add any mode lines. Adjust your editor to display tabs to your
preferred width. Generally code should work with the standard eight column
tabs.

18
19
No short open tags. '<?'
Do not end files with a close tag. '?>'
Loui Chang's avatar
Loui Chang committed
20
21
22
23
24
25
26
27
Try embedding as little XHTML in the PHP as possible.
Consider creating templates for XHTML.

All markup should conform to XHTML 1.0 Strict requirements.
You can use http://validator.w3.org to check the markup.

Prevent PHP Notices by using isset() or empty() in conditionals that
reference $_GET, $_POST, or $_REQUEST variables.
28
29
30

MySQL queries should generally go into functions.

Loui Chang's avatar
Loui Chang committed
31
32
Submitting patches
------------------
33

34
!!! PLEASE TEST YOUR PATCHES BEFORE SUBMITTING !!!
35
Submit uncompressed git-formatted patches to aur-dev@archlinux.org.
36
37

You will need to register on the mailing list before submitting:
38
https://mailman.archlinux.org/mailman/listinfo/aur-dev
39

40
Base your patches on the master branch as forward development is done there.
41
When writing patches please keep unnecessary changes to a minimum.
Loui Chang's avatar
Loui Chang committed
42
43

Try to keep your commits small and focused.
Loui Chang's avatar
Loui Chang committed
44
Smaller patches are much easier to review and have a better chance of being
Loui Chang's avatar
Loui Chang committed
45
46
pushed more quickly into the main repo. Smaller commits also makes reviewing
the commit history and tracking down specific changes much easier.
Loui Chang's avatar
Loui Chang committed
47

48
Try to make your commit messages brief but descriptive.
Loui Chang's avatar
Loui Chang committed
49

50
51
52
53
54
Glossary
--------
git-formatted patch:
	A patch that is produced via `git format-patch` and is sent via
	`git send-email` or as an inline attachment of an email.