Skip to content

Commit

Permalink
[doc] Improve contributing documents and add a script for check commi…
Browse files Browse the repository at this point in the history
…t. (#3213)

* [doc] Improve contributing documents and add a script for check commit.

* fixup

* fixup

* fixup
  • Loading branch information
jolestar authored Feb 17, 2022
1 parent 03b6024 commit 1712f87
Show file tree
Hide file tree
Showing 9 changed files with 290 additions and 5 deletions.
37 changes: 37 additions & 0 deletions .github/ISSUE_TEMPLATE/01_BUG_REPORT.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
---
name: Bug Report
about: Create a report to help Starcoin to improve
title: "bug: "
labels: "bug"
assignees: ""
---

# Bug Report

**Starcoin version:**

<!-- Please specify commit or tag version. -->

**Current behavior:**

<!-- Describe how the bug manifests. -->

**Expected behavior:**

<!-- Describe what the behavior would be without the bug. -->

**Steps to reproduce:**

<!-- Please explain the steps required to duplicate the issue, especially if you are able to provide a sample application. -->

**Related code:**

<!-- If you are able to illustrate the bug or feature request with an example, please provide it here. -->

```
insert short code snippets here
```

**Other information:**

<!-- List any other information that is relevant to your issue. Related issues, suggestions on how to fix, Stack Overflow links, forum links, etc. -->
32 changes: 32 additions & 0 deletions .github/ISSUE_TEMPLATE/02_FEATURE_REQUEST.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
---
name: Feature Request
about: Suggest an idea for this project
title: "feat: "
labels: "enhancement"
assignees: ""
---

# Feature Request

**Describe the Feature Request**

<!-- A clear and concise description of what the feature request is. Please include if your feature request is related to a problem. -->

**Describe Preferred Solution**

<!-- A clear and concise description of what you want to happen. -->

**Describe Alternatives**

<!-- A clear and concise description of any alternative solutions or features you've considered. -->

**Related Code**

<!-- If you are able to illustrate the bug or feature request with an example, please provide it here. -->

**Additional Context**

<!-- List any other information that is relevant to your issue. Stack traces, related issues, suggestions on how to add, use case, Stack Overflow links, forum links, screenshots, OS if applicable, etc. -->

**If the feature request is approved, would you be willing to submit a PR?**
Yes / No _(Help can be provided if you need assistance submitting a PR)_
7 changes: 7 additions & 0 deletions .github/ISSUE_TEMPLATE/03_CODEBASE_IMPROVEMENT.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
---
name: Codebase improvement
about: Provide your feedback for the existing codebase. Suggest a better solution for algorithms, development tools, etc.
title: "dev: "
labels: "enhancement"
assignees: ""
---
6 changes: 6 additions & 0 deletions .github/ISSUE_TEMPLATE/config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
blank_issues_enabled: false
contact_links:
- name: Starcoin Community Support
url: https://github.com/starcoinorg/starcoin/discussions
about: Please ask and answer questions here.
33 changes: 33 additions & 0 deletions .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
<!--- Please provide a general summary of your changes in the title above -->

## Pull request type

<!-- Please try to limit your pull request to one type, submit multiple pull requests if needed. -->

Please check the type of change your PR introduces:

- [ ] Bugfix
- [ ] Feature
- [ ] Code style update (formatting, renaming)
- [ ] Refactoring (no functional changes, no api changes)
- [ ] Build related changes
- [ ] Documentation content changes
- [ ] Other (please describe):

## What is the current behavior?

<!-- Please describe the current behavior that you are modifying, or link to a relevant issue. -->

Issue Number: N/A

## What is the new behavior?

<!-- Please describe the behavior or changes that are being added by this PR. -->

-
-
-

## Other information

<!-- Any other information that is important to this PR such as screenshots of how the component looks before and after the change. -->
45 changes: 45 additions & 0 deletions CODE_OF_CONDUCT.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
# Contributor Covenant Code of Conduct

## Our Pledge

In the interest of fostering an open and welcoming environment, we as contributors and maintainers pledge to make participation in our project and our community a harassment-free experience for everyone, regardless of age, body size, disability, ethnicity, sex characteristics, gender identity and expression, level of experience, education, socio-economic status, nationality, personal appearance, race, religion, or sexual identity and orientation.

## Our Standards

Examples of behavior that contributes to creating a positive environment include:

* Using welcoming and inclusive language
* Being respectful of differing viewpoints and experiences
* Gracefully accepting constructive criticism
* Focusing on what is best for the community
* Showing empathy towards other community members

Examples of unacceptable behavior by participants include:

* The use of sexualized language or imagery and unwelcome sexual attention or advances
* Trolling, insulting/derogatory comments, and personal or political attacks
* Public or private harassment
* Publishing others' private information, such as a physical or electronic address, without explicit permission
* Other conduct which could reasonably be considered inappropriate in a professional setting

## Our Responsibilities

Project maintainers are responsible for clarifying the standards of acceptable behavior and are expected to take appropriate and fair corrective action in response to any instances of unacceptable behavior.

Project maintainers have the right and responsibility to remove, edit, or reject comments, commits, code, wiki edits, issues, and other contributions that are not aligned to this Code of Conduct, or to ban temporarily or permanently any contributor for other behaviors that they deem inappropriate, threatening, offensive, or harmful.

## Scope

This Code of Conduct applies within all project spaces, and it also applies when an individual is representing the project or its community in public spaces. Examples of representing a project or community include using an official project e-mail address, posting via an official social media account, or acting as an appointed representative at an online or offline event. Representation of a project may be further defined and clarified by project maintainers.

## Enforcement

Instances of abusive, harassing, or otherwise unacceptable behavior may be reported by contacting the project maintainer using any of the [[email protected]](mailto:[email protected]). All complaints will be reviewed and investigated and will result in a response that is deemed necessary and appropriate to the circumstances. The project team is obligated to maintain confidentiality with regard to the reporter of an incident. Further details of specific enforcement policies may be posted separately.

Project maintainers who do not follow or enforce the Code of Conduct in good faith may face temporary or permanent repercussions as determined by other members of the project's leadership.

## Attribution

This Code of Conduct is adapted from the [Contributor Covenant](https://www.contributor-covenant.org), version 1.4, available at <https://www.contributor-covenant.org/version/1/4/code-of-conduct.html>

For answers to common questions about this code of conduct, see <https://www.contributor-covenant.org/faq>
60 changes: 60 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
## On Contributing

To contribute to the Starcoin implementation, first start with the proper
development copy.

To get the development installation with all the necessary dependencies for
linting, testing, and building the documentation, run the following:

```bash
git clone https://github.com/starcoinorg/starcoin.git
cd starcoin
./scripts/dev_setup.sh
source $HOME/.cargo/env
cargo build
```

## Our Development Process

### Code Style, Hints, and Testing

All code formatting is enforced with [rustfmt](https://github.com/rust-lang/rustfmt) with a project-specific configuration and checked by github action.


### Developer Workflow

Changes to the project are proposed through pull requests. The general pull
request workflow is as follows:

1. Fork the repo and create a topic branch off of `master`.
2. If you have added code that should be tested, add unit tests.
3. Fast check commit by `./scripts/check_commit.sh`.
4. Make sure your local workspace is clean and all changed file has been committed.
5. Submit your pull request.
6. Waiting for the github action check to pass and responding to reviewer feedback.

Starcoin Move framework contribution document at [Starcoin Move Framework](vm/stdlib/README.md).

#### How to update the pull request

If your pull request is out-of-date and needs to be updated because `master`
has advanced, you should rebase your branch on top of the latest main by
doing the following:

```bash
git fetch upstream
git checkout topic
git rebase -i upstream/master
```

You *should not* update your branch by merging the latest main into your
branch. Merge commits included in PRs tend to make it more difficult for the
reviewer to understand the change being made, especially if the merge wasn't
clean and needed conflicts to be resolved. As such, PRs with merge commits will
be rejected.

## Issues

Starcoin uses [GitHub issues](https://github.com/starcoinorg/starcoin/issues) to track
bugs. Please include necessary information and instructions to reproduce your
issue.
53 changes: 48 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,27 @@
# Starcoin
<h1 align="center">
<a href="https://starcoin.org">
<img src="https://starcoin.org/img/stc.svg" alt="Logo" width="125" height="125">
</a>
</h1>

<div align="center">
Starcoin - a smart contract blockchain network that scales by layering
<br />
<br />
<a href="https://github.com/starcoinorg/starcoin/issues/new?assignees=&labels=bug&template=01_BUG_REPORT.md&title=bug%3A+">Report a Bug</a>
·
<a href="https://github.com/starcoinorg/starcoin/issues/new?assignees=&labels=enhancement&template=02_FEATURE_REQUEST.md&title=feat%3A+">Request a Feature</a>
.
<a href="https://github.com/starcoinorg/starcoin/discussions">Ask a Question</a>
<br />
<br />
</div>


[![Build and Test](https://github.com/starcoinorg/starcoin/workflows/Build%20and%20Test/badge.svg)](https://github.com/starcoinorg/starcoin/actions?query=workflow%3A%22Build+and+Test%22+branch%3Amaster)
[![License](https://img.shields.io/badge/license-Apache-green.svg)](LICENSE)
[![codecov](https://codecov.io/gh/starcoinorg/starcoin/branch/master/graph/badge.svg)](https://codecov.io/gh/starcoinorg/starcoin)

A Layered Cryptocurrency and Decentralized Blockchain System.

## Build from source

Expand Down Expand Up @@ -51,9 +68,35 @@ starcoin --connect ws://main.seed.starcoin.org:9870 console
More detailed test network info please read [Join starcoin test network](https://developer.starcoin.org/en/setup/runnetwork/).

## Contribution
Thank you for considering to help out with the source code! Feel free to submit an issue or pull request.
Starcoin Move stdlib contribution document at [Starcoin Move standard library and framework](vm/stdlib/README.md).

## Roadmap

See the [open issues](https://github.com/starcoinorg/starcoin/issues) for a list of proposed features (and known issues).

- [Top Feature Requests](https://github.com/starcoinorg/starcoin/issues?q=label%3Aenhancement+is%3Aopen+sort%3Areactions-%2B1-desc) (Add your votes using the 👍 reaction)
- [Top Bugs](https://github.com/starcoinorg/starcoin/issues?q=is%3Aissue+is%3Aopen+label%3Abug+sort%3Areactions-%2B1-desc) (Add your votes using the 👍 reaction)
- [Newest Bugs](https://github.com/starcoinorg/starcoin/issues?q=is%3Aopen+is%3Aissue+label%3Abug)
- [Help Wanted](https://github.com/starcoinorg/starcoin/issues?q=label%3A"help+wanted"+is%3Aissue+is%3Aopen)

## Contributing

First off, thanks for taking the time to contribute! Contributions are what makes the open-source community such an amazing place to learn, inspire, and create. Any contributions you make will benefit everybody else and are **greatly appreciated**.

Please try to create bug reports that are:

- _Reproducible._ Include steps to reproduce the problem.
- _Specific._ Include as much detail as possible: which version, what environment, etc.
- _Unique._ Do not duplicate existing opened issues.
- _Scoped to a Single Bug._ One bug per report.

You can learn more about contributing to the Starcoin project by reading our [Contribution Guide](./CONTRIBUTING.md) and by viewing our [Code of Conduct](./CODE_OF_CONDUCT.md).

## Support

Reach out to the maintainer at one of the following places:

- [GitHub discussions](https://github.com/starcoinorg/starcoin/discussions)
- [Starcoin Discord](https://discord.gg/starcoin)

## License

Expand Down
22 changes: 22 additions & 0 deletions scripts/check_commit.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
#!/bin/bash

# Provide a script for fast check the commit.

set -eo pipefail

STARCOIN_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && cd .. && pwd)"

# cargo fmt check
cargo fmt -- --check
# cargo clippy check
cargo clippy --all-targets -- -D warnings
# generate stdlib
cargo run -p stdlib
# generate genesis
cargo run -p starcoin-genesis
# generate rpc schema document
cargo run -p starcoin-rpc-api -- -d ./rpc/generated_rpc_schema
# test config file
cargo test -p starcoin-config test_example_config_compact
# check changed files
"${STARCOIN_DIR}"/scripts/changed-files.sh

0 comments on commit 1712f87

Please sign in to comment.