Skip to content

Commit 86e8766

Browse files
committed
* improved vibecoding support
1 parent 55a4a3f commit 86e8766

File tree

10 files changed

+126
-5
lines changed

10 files changed

+126
-5
lines changed

β€ŽCMakeLists.txtβ€Ž

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
cmake_minimum_required( VERSION 3.13...99.99)
22

3-
project( mulle-objc-developer VERSION 0.28.0 LANGUAGES NONE)
3+
project( mulle-objc-developer VERSION 0.28.1 LANGUAGES NONE)
44

5-
set( PROJECT_VERSION 0.28.0)
5+
set( PROJECT_VERSION 0.28.1)
66

77

88
if( APPLE)

β€ŽRELEASENOTES.mdβ€Ž

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
### 0.28.1
2+
3+
* improved vibecoding support
4+
15
## 0.28.0
26

37
Various small improvements
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
extra
Lines changed: 113 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,113 @@
1+
## Coding Style Guide
2+
3+
<!-- Keywords: edit, c, styleguide -->
4+
5+
This document outlines the coding conventions. All contributions must adhere to
6+
these rules to maintain code consistency and readability.
7+
8+
### 1. Formatting
9+
10+
#### 1.1. Indentation
11+
- Use three (3) spaces for each level of indentation. Do not use tabs.
12+
13+
#### 1.2. Bracing
14+
- Use the Allman style for braces. The opening and closing braces for a block
15+
are placed on their own lines and are vertically aligned.
16+
17+
```c
18+
if( condition)
19+
{
20+
...
21+
}
22+
```
23+
24+
#### 1.3. Spacing
25+
- **Control Structures & Function Calls:** No space between a
26+
keyword/function name and the opening parenthesis. A space follows the
27+
opening parenthesis.
28+
- `if( condition)`
29+
- `while( i < n)`
30+
- `[self doSomethingWith: arg]`
31+
- **Expressions:** No spaces immediately inside parentheses for grouping
32+
expressions.
33+
- `x = (a + b) * c;`
34+
35+
#### 1.4. Columnar Alignment
36+
- Align similar elements vertically for readability, especially assignment
37+
operators.
38+
39+
```c
40+
char *a;
41+
int b;
42+
43+
a = "foo";
44+
b = 1848;
45+
```
46+
47+
#### 1.5. `return` Statements
48+
- Parenthesize the return expression: `return( expr);`.
49+
- Do not use parentheses when there is no return value: `return;`.
50+
51+
### 2. Declarations & Initialization
52+
53+
#### 2.1. Variable Declaration
54+
- Declare all local variables at the top of the function block (C89 style).
55+
- Sort variable declarations alphabetically by name.
56+
- Declare one variable per line, except for trivial counters
57+
(e.g., `int i, n;`).
58+
59+
#### 2.2. Initialization
60+
- Variables should not be initialized at declaration by default.
61+
- **Exceptions:**
62+
1. When initializing from a function argument, often involving a cast.
63+
2. When initializing an aggregate type (struct, array) to zero, which
64+
replaces a subsequent `memset(..., 0, ...)`. If an aggregate is
65+
initialized this way, the corresponding `memset` must be removed.
66+
67+
### 3. Control Flow
68+
69+
#### 3.1. `case` and `goto` Labels
70+
- `case` statements and `goto` labels are not indented relative to the
71+
block they are in. They align with the opening brace of the `switch` or
72+
function block.
73+
74+
```c
75+
switch( value)
76+
{
77+
case 0:
78+
...
79+
break;
80+
81+
default:
82+
...
83+
break;
84+
}
85+
```
86+
87+
#### 3.2. Single-Statement Blocks
88+
- Avoid single-line statements for blocks (e.g., `if(condition) statement;`).
89+
- Use braces for all blocks, except for single-line statements, when it has
90+
no continuation and its visual association with the control structure is
91+
unambiguous.
92+
93+
## 4. Objective-C Specific
94+
95+
### 4.1. General coding style
96+
97+
- Do not use `-retain` or `copy` or `-release` or `autorelease` (exception: inside `-init` and `-dealloc` and "accessor" methods)
98+
- Do not use `+alloc` `-init` use `+instance` or an appropriate factory method like `-[NSMutableArray array]`
99+
100+
### 4.2. Property Access
101+
- Do not use dot-syntax for property access.
102+
- Prefer non-mutable state in properties, prefer `(copy)` over `(retain)` when possible
103+
- Do not use strong use retain or copy instead
104+
- Do not use weak, use assign instead
105+
- Convert all property reads and writes to explicit message sends.
106+
- **Read:** `[self property]` instead of `self.property`.
107+
- **Write:** `[self setProperty:value]` instead of `self.property = value`.
108+
109+
110+
## Tip:
111+
112+
NSString, NSArray and most other Foundation classes are not available
113+
with mulle-objc/objc-developer, you want foundation/objc-developer for that.
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Add mulle Objective-C styleguide to project
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
0.28.1
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
mulle-objc cmake project based on <MulleObjC/MulleObjC.h>
1+
mulle-objc cmake project based on <MulleObjC/MulleObjC.h> - does not have NSString or NSArray
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
0.21.0
1+
0.28.1

β€Žsrc/mulle-objc/objc/demo.append/all/AGENTS.mdβ€Ž

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ This is a mulle-objc Objective C project.
1717
- **Write:** `[self setProperty:value]` instead of `self.property = value`
1818
- Do not use class properties
1919
- Do not use `atomic`, `weak`, `strong`
20+
- `char *` properties that hold UTF8 strings must be names <prefix>UTF8String
2021

2122
### No Blocks
2223

β€Žsrc/mulle-objc/objc/versionβ€Ž

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
0.28.0
1+
0.28.1

0 commit comments

Comments
Β (0)