Skip to content

Commit

Permalink
docs(contributing.md): Add contributing documents
Browse files Browse the repository at this point in the history
  • Loading branch information
ValiantCat committed Mar 4, 2019
1 parent ac93b79 commit 517c27f
Show file tree
Hide file tree
Showing 6 changed files with 193 additions and 1 deletion.
70 changes: 70 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
# Contributing to coobjc

We love contributions to the coobjc project and request you follow the guidelines below. If you have any questions, or need any help, open an [ISSUE](https://github.com/alibaba/coobjc/issues/new/choose).

## Table of Contents

<!-- TOC -->

- [Contributing to coobjc](#contributing-to-coobjc)
- [Getting Started](#getting-started)
- [Pull Requests](#pull-requests)
- [Asking Questions](#asking-questions)
- [Reporting Issues](#reporting-issues)
- [Additional Resources](#additional-resources)

<!-- /TOC -->

## Getting Started

To get started, you will need to open a Terminal and:

1. Fork this repo and clone it onto your machine.

`$ git clone https://github.com/YOUR_GITHUB_ID/[email protected]:alibaba/coobjc.git`

2. Make changes to code, usually by tackling an issue. A list of issues can be found [ISSUE](https://github.com/alibaba/coobjc/issues).

If there aren't any tagged issues, open a [Feature ISSUE](https://github.com/alibaba/coobjc/issues/new?assignees=&labels=&template=feature_request.md&title=).

3. All source code submitted requires an Apache License header at the top of the file. This text can be found [Here](./docs/common/Copyright.txt), just copy and paste it at the top of any new files you're submitting.
<!--
TODOS:
4. Ensure all tests pass with your changes and test coverage must greater than before. If there is any new functionality introduced by your changes, new test case(s) may be required.
5. codeStyle
-->
4. Commit message should conform to [commit message templates](./docs/common/commentformat.txt).

5. If the tests all pass, open a Pull Request following the guidelines below.

## Pull Requests

<!--
**Note:** Before opening a Pull Request, please run the tests and check them all pass and keep test coverage greater than or equal before.
coobjc uses [Continuous Integration](https://en.wikipedia.org/wiki/Continuous_integration). You may see mentions of [Travis CI](https://travis-ci.com/) in your PR and its comments. Travis is an external service we use that is automatically called on every PR, and runs the test cases on macOS and iPhone simulator to ensure every code change is stable.
To open a new Pull Request, the GitHub website provides the simplest experience for new users. Go to your fork of the repo and click the New pull request button. You will be presented with a page featuring base fork: and base:, then an arrow, and then head fork: compare:. Make sure compare: has **your branch** with your changes selected and base: has **master** selected. When you are ready to open the PR, click the green button at the top called Create pull request.
-->

When opening a PR, please:

1. Create minimal differences and do not reformat the code. If you feel the codes structure needs changing, open a separate PR.
2. Check for unnecessary white space using `git diff --check` before you commit your code.
3. Squash all commit as one on feature branch.

## Asking Questions

If you have any questions, Comment on existing issues, or raise new ones if you discover something.

## Reporting Issues

See the [issue template](.github/ISSUE_TEMPLATE/).

---

### Additional Resources

- [GitHub Help - Homepage](https://help.github.com)
- [Creating a Pull Request - GitHub Help](https://help.github.com/articles/creating-a-pull-request/)
67 changes: 67 additions & 0 deletions CONTRIBUTING_CHINESE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
# 为 coobjc 贡献代码

我们鼓励使用者为 coobjc 项目做出贡献,贡献代码的规则可以参考下面的条例。

如果你碰见了一些不明白的问题或者是需要和开发组人员交流,可以打开一个新的 [ISSUE](https://github.com/alibaba/coobjc/issues/new/choose) 来跟踪你的疑问。
## 目录

<!-- TOC -->

- [为 coobjc 贡献代码](#为-coobjc-贡献代码)
- [快速入手](#快速入手)
- [创建 Pull Requests](#创建-pull-requests)
- [提问](#提问)
- [报告 Issues](#报告-ISSUE)
- [参考信息](#参考信息)

<!-- /TOC -->

## 快速入手

为了给 coobjc 贡献代码,你应该打开一个终端

1. 首先 fork 本项目,然后 clone 到本地的工作目录。

`$ git clone https://github.com/YOUR_GITHUB_ID/[email protected]:alibaba/coobjc.git `

2. 通常一次 Pull Request 是为了解决一个 ISSUE, 已有的 ISSUE 列表可以在 [这里](https://github.com/alibaba/coobjc/issues) 找到。

如果没有相关联的 ISSUE, 可以开启一个 [新特性 ISSUE](https://github.com/alibaba/coobjc/issues/new?assignees=&labels=&template=feature_request.md&title=),我们将会与你讨论这次贡献。

3. coobjc 项目使用 Apache License 2.0 协议发布。因此每个文件头部信息必须带上相关协议版权信息。对于一个新文件可以通过以下链接 [License](./docs/common/Copyright.txt) 找到这个模板,将其复制在新文件的顶部即可。
<!--
TODOS:
4. 创建新的 PR 前应该保证所有的测试用例是通过的,并且测试用例的覆盖率要大于之前的。如果你对项目添加了新的功能,相应的也需要补充对应的测试用例。
5. codeStyle
-->
4. 提交信息要遵守如下模板 [commit message templates](./docs/common/commentformat.txt)

65 如果以上步骤都满足,就可以创建你的 PR 了。

## 创建 Pull Requests

<!--
**注意:** 创建 PR 前一定要确保所有的测试用例通过并且测试用例的覆盖率要大于或等于之前。
coobjc 使用 [持续集成](https://en.wikipedia.org/wiki/Continuous_integration). 因此你可能在你的 PR 中看到 [Travis CI](https://travis-ci.com/) 相关的评论. Travis CI 是一个外部工具,我们使用这个工具检查每个 PR 然后测试对应的测试用例,如果测试用例失败了 这个 PR 不能合入到 master 分支。使用 Travis CI 工具可以确保每次提交代码的稳定性。
-->
当你创建一个PR时,请检查如下要求

1. 请在本地做相关的 diff 确保无关的代码风格没有发生改变,如果你认为代码风格有问题,创建一个单独的 PR 来修改这个问题。
2. 提交代码前使用 `git diff --check` 命令检查下是否有多余的空白字符和换行。
3. 在特性分支上,请将所有的 commit 合并为一个,以便保持 master 分支的清晰。

## 提问

如果你有其他方面的疑惑或者需要和开发人员沟通, 可以打开一个新的 ISSUE.

## 报告 ISSUE

如果有 ISSUE 需要提出,请遵守此 [模板](.github/ISSUE_TEMPLATE/)

---

### 参考信息

- [GitHub 帮助页面](https://help.github.com)
- [如何创建一个拉取请求](https://help.github.com/articles/creating-a-pull-request/)
5 changes: 4 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -509,8 +509,11 @@ coobjc couldn't exist without:
* [ValiantCat](https://github.com/ValiantCat)
* [jmpews](https://github.com/jmpews)
## 0x9 Contributing
## 0x9 License
* [Contributing](./CONTRIBUTING.md)
## 0x10 License
coobjc is released under the Apache 2.0 license. See [LICENSE](LICENSE) for details.
<br />
Expand Down
3 changes: 3 additions & 0 deletions README_cn.md
Original file line number Diff line number Diff line change
Expand Up @@ -516,6 +516,9 @@ coobjc 离不开下面这些项目和文章的帮助:
* [ValiantCat](https://github.com/ValiantCat)
* [jmpews](https://github.com/jmpews)

## 0x9贡献代码
* [贡献指南](./CONTRIBUTING_CHINESE.md)

## 0x9 协议

coobjc 使用 Apache 2.0 协议,详情见 [LICENSE](LICENSE) 文件。
14 changes: 14 additions & 0 deletions docs/common/Copyright.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
//
// Copyright © 2018 Alibaba Group Holding Limited All rights reserved.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
35 changes: 35 additions & 0 deletions docs/common/commentformat.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
<type>(<scope>) : <subject>

<body>


<footer>


#type value under below
# .feat :new feature
# .fix :fix some bug
# .refactor :refactor some code
# .perf :optimization performance
# .test :add more test case
#
#scope : describe effeter
# .all :Widely affected, should pay attention to this commit.
# .loation :little influence.

#
#subject: subject about this commit.
#
#body :detail describe about this commit.
#
#footer :associate issue id or other infomation.
#

# An Example

#
#feat(location) : <Description method>
#
# add description to EZRNode
#
# [Associate with issued id]

0 comments on commit 517c27f

Please sign in to comment.