From e4b6e7424914fd4aab2e12c227333368668f4475 Mon Sep 17 00:00:00 2001 From: Eugene Kim Date: Fri, 11 Jan 2019 10:36:47 -0800 Subject: [PATCH] Move PR/workflow/coding standard into CONTRIBUTION --- CONTRIBUTING.md | 44 ++++++++++++++++++++++++++++++++++++++++++++ README.md | 44 ++------------------------------------------ 2 files changed, 46 insertions(+), 42 deletions(-) create mode 100644 CONTRIBUTING.md diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md new file mode 100644 index 000000000..cc484b7cd --- /dev/null +++ b/CONTRIBUTING.md @@ -0,0 +1,44 @@ +# Contributing To Harmony + +## Coding Guidelines + +* In general, we follow [effective_go](https://golang.org/doc/effective_go.html) +* Code must adhere to the official [Go formatting guidelines](https://golang.org/doc/effective_go.html#formatting) (i.e. uses [gofmt](https://golang.org/cmd/gofmt/)). +* Code must be documented adhering to the official Go [commentary](https://golang.org/doc/effective_go.html#commentary) guidelines. + +## Pull Request (PR) + +This [github document](https://help.github.com/articles/creating-a-pull-request/) provides some guidance on how to create a pull request in github. + +## PR requirement +To pursue engineering excellence, we have insisted on the highest stardard on the quality of each PR. + +* For each PR, please run [golint](https://github.com/golang/lint), [gofmt](https://golang.org/cmd/gofmt/), to fix the basic issues/warnings. +* Make sure you understand [How to Write a Git Commit Message](https://chris.beams.io/posts/git-commit/). +* Add a [Test] section in every PR detailing on your test process and results. If the test log is too long, please include a link to [gist](https://gist.github.com/) and add the link to the PR. + +## Typical workflow example +The best practice is to reorder and squash your local commits before the PR submission to create an atomic and self-contained PR. +This [book chapter](https://git-scm.com/book/en/v2/Git-Tools-Rewriting-History) provides detailed explanation and guidance on how to rewrite the local git history. + +For exampple, a typical workflow is like the following. +```bash +# assuming you are working on a fix of bug1, and use a local branch called "fixes_of_bug1". + +git clone https://github.com/harmony-one/harmony +cd harmony + +# create a local branch to keep track of the origin/master +git branch fixes_of_bug1 origin/master +git checkout fixes_of_bug_1 + +# make changes, build, test locally, commit changes locally +# don't forget to squash or rearrange your commits using "git rebase -i" +git rebase -i origin/master + +# rebase your change on the top of the tree +git pull --rebase + +# push your branch and create a PR +git push origin fixes_of_bug_1:pr_fixes_of_bug_1 +``` diff --git a/README.md b/README.md index 54b44bd24..35135a20b 100644 --- a/README.md +++ b/README.md @@ -4,13 +4,6 @@ ![Discord](https://img.shields.io/discord/532383335348043777.svg) -## Coding Guidelines - -* In general, we follow [effective_go](https://golang.org/doc/effective_go.html) -* Code must adhere to the official [Go formatting guidelines](https://golang.org/doc/effective_go.html#formatting) (i.e. uses [gofmt](https://golang.org/cmd/gofmt/)). -* Code must be documented adhering to the official Go [commentary](https://golang.org/doc/effective_go.html#commentary) guidelines. - - ## Dev Environment Setup ```bash @@ -73,42 +66,9 @@ Make sure you the following command and make sure everything passed before submi ./test/test_before_submit.sh ``` -## Pull Request (PR) - -This [github document](https://help.github.com/articles/creating-a-pull-request/) provides some guidance on how to create a pull request in github. +## Contributing To Harmony -### PR requirement -To pursue engineering excellence, we have insisted on the highest stardard on the quality of each PR. - -* For each PR, please run [golint](https://github.com/golang/lint), [gofmt](https://golang.org/cmd/gofmt/), to fix the basic issues/warnings. -* Make sure you understand [How to Write a Git Commit Message](https://chris.beams.io/posts/git-commit/). -* Add a [Test] section in every PR detailing on your test process and results. If the test log is too long, please include a link to [gist](https://gist.github.com/) and add the link to the PR. - -### Typical workflow example -The best practice is to reorder and squash your local commits before the PR submission to create an atomic and self-contained PR. -This [book chapter](https://git-scm.com/book/en/v2/Git-Tools-Rewriting-History) provides detailed explanation and guidance on how to rewrite the local git history. - -For exampple, a typical workflow is like the following. -```bash -# assuming you are working on a fix of bug1, and use a local branch called "fixes_of_bug1". - -git clone https://github.com/harmony-one/harmony -cd harmony - -# create a local branch to keep track of the origin/master -git branch fixes_of_bug1 origin/master -git checkout fixes_of_bug_1 - -# make changes, build, test locally, commit changes locally -# don't forget to squash or rearrange your commits using "git rebase -i" -git rebase -i origin/master - -# rebase your change on the top of the tree -git pull --rebase - -# push your branch and create a PR -git push origin fixes_of_bug_1:pr_fixes_of_bug_1 -``` +See [`CONTRIBUTING`](CONTRIBUTING.md) for details. ## Development Status