Repository navigation
Expand file tree
/
Copy pathCONTRIBUTING
More file actions
191 lines (113 loc) · 3.73 KB
/
Copy pathCONTRIBUTING
File metadata and controls
191 lines (113 loc) · 3.73 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
# Contributing to Kairo
Thanks for your interest in contributing to Kairo.
Kairo is a production-grade compiler and toolchain. Contributions are expected to meet a high standard of correctness, clarity, and maintainability.
---
## Before You Start
- Read this document fully
- Ensure your contribution aligns with the project's architecture
- For large changes, open an issue first
Unapproved large changes may be rejected.
---
## Ways to Contribute
### Bug Reports
If you encounter a bug, submit an issue with:
- Minimal reproducible example
- Expected vs actual behavior
- Environment details (OS, compiler flags, version)
Low-effort reports may be ignored.
---
### Bug Fixes
- Reference the issue being fixed
- Keep the fix minimal and focused
- Add a test that fails before and passes after
---
### Features / Large Changes
Before implementation:
1. Open an issue
2. Clearly describe:
- Problem
- Proposed solution
- Alternatives considered
Wait for approval before proceeding.
---
## Development Standards
### Code Quality
- Follow existing architecture and patterns
- Prefer clarity over cleverness
- Avoid unnecessary abstractions
- Ideally no dead code or commented-out blocks
---
### Compiler Integrity
Changes must integrate cleanly with:
- AST
- Semantic analysis
- Code generation pipeline
Workarounds that bypass core systems will be rejected.
---
### Testing
All non-trivial changes must include:
- Unit or integration tests
- Edge case coverage where applicable
No tests == no merge.
---
### Commits
Each commit must:
- Be atomic (one logical change)
- Have a clear message:
```text
[component] <brief description>
- Optionally a more detailed explanation of the change, rationale, and any relevant context.
```
Examples:
`[parser] Fix incorrect handling of nested generics`
```text
[codegen] Add support for 128-bit integers
- This adds support for i128 and u128 types in code generation.
- It required changes to the register allocator and instruction selection.
- Tests were added to cover basic usage and edge cases.
```
Avoid vague messages like "fixed things".
---
### Pull Requests
Before submitting:
- Rebase onto latest `main`
- Ensure clean build
- Ensure all tests pass. See BUILD.md for building and running the test suite (lit).
PRs must:
- Explain *why* the change is needed
- Avoid unrelated changes
- Be reviewable in isolation
Messy PRs will be rejected.
---
## Code Review
- Reviews are strict and technical
- Address all feedback before requesting re-review
- Inactive or unresponsive PRs may be closed
---
## Licensing (Required)
By contributing, you agree that:
- Code and other material: **Apache-2.0 WITH AdditionRef-Kairo-Runtime-exception**
- Documentation under `Compiler/Spec/`: **CC BY 4.0**
See `CLA.md` for full terms.
---
## Contributor License Agreement (CLA)
All contributors must agree to the Kairo CLA.
By submitting a contribution, you confirm that you have read and agreed to the terms in `CLA.md`. The CLA bot will ask you to accept on your first pull request.
Forks must not use the Kairo name; see `TRADEMARKS.md`.
---
## Security
Do not open public issues for vulnerabilities. Report them as described in `SECURITY.md`.
---
## Communication
- Use GitHub Issues for discussions
- Keep communication clear and technical
- Avoid vague or speculative proposals
---
## What Not to Do
- Do not submit large changes without prior discussion
- Do not introduce new patterns without justification
- Do not bypass core systems for quick fixes
- Do not include unrelated changes in a single PR
---
## Final Note
Kairo is being built as a serious compiler infrastructure. Contributions should improve the system-not increase complexity without clear benefit. If unsure, ask before building.