Skip to content

Commit d8faf42

Browse files
committed
Coding Conventions now documented
1 parent 96f2f5a commit d8faf42

File tree

1 file changed

+48
-0
lines changed

1 file changed

+48
-0
lines changed

CodingConventions.md

+48
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
Coding Conventions
2+
==================
3+
4+
- 120 characters per line
5+
- 4 spaces instead of tabs
6+
- no trailing whitespace (or other whitespace errors)
7+
- define methods like in the code sample below
8+
9+
Sample code
10+
-----------
11+
12+
- (SomeType *)myMehodName
13+
{
14+
/* code */
15+
}
16+
17+
18+
Check script
19+
------------
20+
21+
Just run `./syncheck.sh` in the root directory of FRLayeredNavigationController.
22+
23+
Automatic check when committing
24+
-------------------------------
25+
26+
Just paste the following in a terminal (being at the root directory of
27+
FRLayeredNavigationController). Paste it entirely (one-shot). This will give you
28+
automatic checking when committing.
29+
30+
cat > .git/hooks/pre-commit <<EOF
31+
#!/bin/sh
32+
33+
echo "Checking syntax"
34+
echo "---------------"
35+
./syncheck.sh
36+
if [ $? -ne 0 ]; then
37+
echo "-------------------------------------------------"
38+
echo "SYNTAX CHECK FAILED, CANNOT COMMIT. Please fix..."
39+
echo
40+
echo "If you really can't fix the syntax errors use"
41+
echo " git commit --no-verify ..."
42+
exit 1
43+
fi
44+
45+
exit 0
46+
EOF
47+
chmod +x .git/hooks/pre-commit
48+

0 commit comments

Comments
 (0)