From 091f0637060f62b5a94e9594b062f56919c2192c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kim=20=22BKC=22=20Carlb=C3=A4cker?= Date: Mon, 13 Feb 2017 03:35:57 +0100 Subject: [PATCH] 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 --- CONTRIBUTING.md | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index bc12ca3da..f98facb2c 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -44,6 +44,25 @@ Please try to make your pull request easy to review for us. Please read the "[Ho * 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. * Split big pull requests into multiple small ones. An incremental change will be faster to review than a huge PR. +## Styleguide + +For imports you should use the following format (_without_ the comments) +```go +import ( + // stdlib + "encoding/json" + "fmt" + + // local packages + "code.gitea.io/gitea/models" + "code.gitea.io/sdk/gitea" + + // external packages + "github.com/foo/bar" + "gopkg.io/baz.v1" +) +``` + ## Sign your work 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: