From 3f35d98954534256f2dcbab09c367200533080fa Mon Sep 17 00:00:00 2001 From: Nathan Stocks Date: Sun, 24 Jan 2021 16:51:05 -0700 Subject: [PATCH 1/3] Add a CONTRIBUTING.md --- CONTRIBUTING.md | 14 ++++++++++++++ README.md | 3 ++- 2 files changed, 16 insertions(+), 1 deletion(-) create mode 100644 CONTRIBUTING.md diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md new file mode 100644 index 0000000000000..bfcda28399900 --- /dev/null +++ b/CONTRIBUTING.md @@ -0,0 +1,14 @@ +# How to Contribute + +1. Fork the repository +2. Make your changes in a local clone of your fork +4. For a higher chance of CI passing the first time, consider running the following commands and fixing any errors or warnings (CI is currently pinned to a specific nightly version, so results may not match exactly): + 1. `cargo fmt` + 2. `cargo clippy` +5. Push your changes to your fork and open a [Pull Request][pull] +6. Respond to any CI failures or review feedback. + +Remember to follow Bevy's [Code of Conduct][coc], and thanks for contributing! + +[coc]: https://github.com/bevyengine/bevy/blob/master/CODE_OF_CONDUCT.md +[pull]: https://github.com/bevyengine/bevy/compare \ No newline at end of file diff --git a/README.md b/README.md index 0c1e79045b609..adbd50b67097c 100644 --- a/README.md +++ b/README.md @@ -36,7 +36,8 @@ Bevy is still in the _very_ early stages of development. APIs can and will chang ## Community -Before contributing or participating in discussions with the community, you should familiarize yourself with our **[Code of Conduct](https://github.com/bevyengine/bevy/blob/master/CODE_OF_CONDUCT.md)** +Before contributing or participating in discussions with the community, you should familiarize yourself with our **[Code of Conduct](https://github.com/bevyengine/bevy/blob/master/CODE_OF_CONDUCT.md)** and +**[How to Contribute](https://github.com/bevyengine/bevy/blob/master/CONTRIBUTING.md)** * **[Discord](https://discord.gg/gMUk5Ph):** Bevy's official discord server. * **[Reddit](https://reddit.com/r/bevy):** Bevy's official subreddit. From 859793fdffe77e2e32c8eed70917a86b3f211c1c Mon Sep 17 00:00:00 2001 From: Nathan Stocks Date: Sun, 24 Jan 2021 22:49:13 -0700 Subject: [PATCH 2/3] Point to book. Add tools/ci script. --- .github/CONTRIBUTING.md | 4 ++++ CONTRIBUTING.md | 14 -------------- tools/ci | 20 ++++++++++++++++++++ 3 files changed, 24 insertions(+), 14 deletions(-) create mode 100644 .github/CONTRIBUTING.md delete mode 100644 CONTRIBUTING.md create mode 100755 tools/ci diff --git a/.github/CONTRIBUTING.md b/.github/CONTRIBUTING.md new file mode 100644 index 0000000000000..49fda44c9ac56 --- /dev/null +++ b/.github/CONTRIBUTING.md @@ -0,0 +1,4 @@ +# Contributing + +Please see the [Contributing Code](https://bevyengine.org/learn/book/contributing/code/) section of +[The Book](https://bevyengine.org/learn/book/introduction/). \ No newline at end of file diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md deleted file mode 100644 index bfcda28399900..0000000000000 --- a/CONTRIBUTING.md +++ /dev/null @@ -1,14 +0,0 @@ -# How to Contribute - -1. Fork the repository -2. Make your changes in a local clone of your fork -4. For a higher chance of CI passing the first time, consider running the following commands and fixing any errors or warnings (CI is currently pinned to a specific nightly version, so results may not match exactly): - 1. `cargo fmt` - 2. `cargo clippy` -5. Push your changes to your fork and open a [Pull Request][pull] -6. Respond to any CI failures or review feedback. - -Remember to follow Bevy's [Code of Conduct][coc], and thanks for contributing! - -[coc]: https://github.com/bevyengine/bevy/blob/master/CODE_OF_CONDUCT.md -[pull]: https://github.com/bevyengine/bevy/compare \ No newline at end of file diff --git a/tools/ci b/tools/ci new file mode 100755 index 0000000000000..aa970e108b5cf --- /dev/null +++ b/tools/ci @@ -0,0 +1,20 @@ +#!/usr/bin/env bash + +# This script is intended to mimic some CI behavior that we encourage contributors to run locally. +# For the actual CI run on GitHub, see the files in .github/workflows/ + +# Exit when any command fails +set -e + +# Keep track of the last executed command +trap 'last_command=$current_command; current_command=$BASH_COMMAND' DEBUG +# Echo an error message before exiting, so you can see exactly what command and what error code +trap 'echo "\"${last_command}\" command filed with exit code $?."' EXIT + +## ACTUAL COMMANDS + +# Auto-format Rust files +cargo +nightly fmt --all + +# Run a more intensive linter +cargo clippy --all-targets --all-features -- -D warnings -A clippy::type_complexity -A clippy::manual-strip \ No newline at end of file From 2099808b6be57596d15aa39783f821863d31538c Mon Sep 17 00:00:00 2001 From: Nathan Stocks Date: Mon, 25 Jan 2021 20:17:32 -0700 Subject: [PATCH 3/3] Update contributing link to point to book --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index adbd50b67097c..35ea02ae026ec 100644 --- a/README.md +++ b/README.md @@ -37,7 +37,7 @@ Bevy is still in the _very_ early stages of development. APIs can and will chang ## Community Before contributing or participating in discussions with the community, you should familiarize yourself with our **[Code of Conduct](https://github.com/bevyengine/bevy/blob/master/CODE_OF_CONDUCT.md)** and -**[How to Contribute](https://github.com/bevyengine/bevy/blob/master/CONTRIBUTING.md)** +**[How to Contribute](https://bevyengine.org/learn/book/contributing/code/)** * **[Discord](https://discord.gg/gMUk5Ph):** Bevy's official discord server. * **[Reddit](https://reddit.com/r/bevy):** Bevy's official subreddit.