You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: CONTRIBUTING.md
+18-24Lines changed: 18 additions & 24 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -146,6 +146,16 @@ If your PR could cause a breaking change you must add a BREAKING section to this
146
146
147
147
To explain how this could affect users and how to mitigate these changes.
148
148
149
+
Once code review starts on your PR, do not rebase nor squash your branch as it makes it
150
+
difficult to review the new changes. Only if there is a need, sync your branch by merging
151
+
the base branch into yours. Don't worry about merge commits messing up your tree as
152
+
the final merge process squashes all commits into one, with the visible commit message (first
153
+
line) being the PR title + PR index and description being the PR's first comment.
154
+
155
+
Once your PR gets the `lgtm/done` label, don't worry about keeping it up-to-date or breaking
156
+
builds (unless there's a merge conflict or a request is made by a maintainer to make
157
+
modifications). It is the maintainer team's responsibility from this point to get it merged.
158
+
149
159
## Styleguide
150
160
151
161
For imports you should use the following format (*without* the comments)
@@ -170,17 +180,22 @@ import (
170
180
171
181
To maintain understandable code and avoid circular dependencies it is important to have a good structure of the code. The Gitea code is divided into the following parts:
172
182
173
-
-**integration:** Integration tests
174
183
-**models:** Contains the data structures used by xorm to construct database tables. It also contains supporting functions to query and update the database. Dependencies to other code in Gitea should be avoided although some modules might be needed (for example for logging).
175
184
-**models/fixtures:** Sample model data used in integration tests.
176
185
-**models/migrations:** Handling of database migrations between versions. PRs that changes a database structure shall also have a migration step.
177
-
-**modules:** Different modules to handle specific functionality in Gitea.
186
+
-**modules:** Different modules to handle specific functionality in Gitea. Shall only depend on other modules but not other packages (models, services).
-**routers:** Handling of server requests. As it uses other Gitea packages to serve the request, other packages (models, modules or services) shall not depend on routers
188
+
-**routers:** Handling of server requests. As it uses other Gitea packages to serve the request, other packages (models, modules or services) shall not depend on routers.
180
189
-**services:** Support functions for common routing operations. Uses models and modules to handle the request.
181
190
-**templates:** Golang templates for generating the html output.
191
+
-**tests/e2e:** End to end tests
192
+
-**tests/integration:** Integration tests
182
193
-**vendor:** External code that Gitea depends on.
183
194
195
+
## Documentation
196
+
197
+
If you add a new feature or change an existing aspect of Gitea, the documentation for that feature must be created or updated.
198
+
184
199
## API v1
185
200
186
201
The API is documented by [swagger](http://try.gitea.io/api/swagger) and is based on [GitHub API v3](https://developer.github.com/v3/).
@@ -229,27 +244,6 @@ An endpoint which changes/edits an object expects all fields to be optional (exc
229
244
- support pagination (`page` & `limit` options in query)
230
245
- set `X-Total-Count` header via **SetTotalCountHeader** ([example](https://github.com/go-gitea/gitea/blob/7aae98cc5d4113f1e9918b7ee7dd09f67c189e3e/routers/api/v1/repo/issue.go#L444))
231
246
232
-
## Large Character Comments
233
-
234
-
Throughout the codebase there are large-text comments for sections of code, e.g.:
235
-
236
-
```go
237
-
// __________ .__
238
-
// \______ \ _______ _|__| ______ _ __
239
-
// | _// __ \ \/ / |/ __ \ \/ \/ /
240
-
// | | \ ___/\ /| \ ___/\ /
241
-
// |____|_ /\___ >\_/ |__|\___ >\/\_/
242
-
// \/ \/ \/
243
-
```
244
-
245
-
These were created using the `figlet` tool with the `graffiti` font.
246
-
247
-
A simple way of creating these is to use the following:
0 commit comments