-
Notifications
You must be signed in to change notification settings - Fork 290
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[doc] Improve contributing documents and add a script for check commi…
…t. (#3213) * [doc] Improve contributing documents and add a script for check commit. * fixup * fixup * fixup
- Loading branch information
Showing
9 changed files
with
290 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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. --> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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)_ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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: "" | ||
--- |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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. --> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |