Skip to content

Commit 091f063

Browse files
bkcsoftlunny
authored andcommitted
Add import-styleguide to Contributing.md (#912)
* Add import-styleguide to Contributing.md Question: should we group all `code.gitea.io`-packages together as local imports? (including `code.gitea.io/sdk` and `code.gitea.io/git` etc) * reorg * be specific FFS
1 parent 0515780 commit 091f063

File tree

1 file changed

+19
-0
lines changed

1 file changed

+19
-0
lines changed

CONTRIBUTING.md

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,25 @@ Please try to make your pull request easy to review for us. Please read the "[Ho
4444
* Don't make changes unrelated to your PR. Maybe there are typos on some comments, maybe refactoring would be welcome on a function... but if that is not related to your PR, please make *another* PR for that.
4545
* Split big pull requests into multiple small ones. An incremental change will be faster to review than a huge PR.
4646

47+
## Styleguide
48+
49+
For imports you should use the following format (_without_ the comments)
50+
```go
51+
import (
52+
// stdlib
53+
"encoding/json"
54+
"fmt"
55+
56+
// local packages
57+
"code.gitea.io/gitea/models"
58+
"code.gitea.io/sdk/gitea"
59+
60+
// external packages
61+
"github.com/foo/bar"
62+
"gopkg.io/baz.v1"
63+
)
64+
```
65+
4766
## Sign your work
4867

4968
The sign-off is a simple line at the end of the explanation for the patch. Your signature certifies that you wrote the patch or otherwise have the right to pass it on as an open-source patch. The rules are pretty simple: If you can certify [DCO](DCO), then you just add a line to every git commit message:

0 commit comments

Comments
 (0)