From 4d1f84bbfffb322b724a1fa178b74d0e315fcbee Mon Sep 17 00:00:00 2001 From: Andre Richter Date: Mon, 4 Jan 2021 17:51:38 +0100 Subject: [PATCH] Add pull request template --- .github/pull_request_template.md | 13 +++++++++++++ .github/workflows/sanity.yml | 2 +- contributor_setup.sh | 28 ++++++++++++++++++++++++++++ utils/devtool.rb | 2 +- 4 files changed, 43 insertions(+), 2 deletions(-) create mode 100644 .github/pull_request_template.md diff --git a/.github/pull_request_template.md b/.github/pull_request_template.md new file mode 100644 index 00000000..98339970 --- /dev/null +++ b/.github/pull_request_template.md @@ -0,0 +1,13 @@ +### Description + + + +Related Issue: + +### Pre-commit steps + + - [ ] Tested on QEMU and real HW Rasperry Pi. + - Not needed if it is just a README change or similar. + - [ ] Ran `./contributor_setup.sh` followed by `./devtool ready_for_publish` + - You'll need `Ruby` with `Bundler` and `NPM` installed locally. + - This step is optional, but much appreciated if done. diff --git a/.github/workflows/sanity.yml b/.github/workflows/sanity.yml index 46c559a8..2c4551f2 100644 --- a/.github/workflows/sanity.yml +++ b/.github/workflows/sanity.yml @@ -41,7 +41,7 @@ jobs: - name: Setup misspell run: | curl -L -o ./install-misspell.sh https://git.io/misspell - sh ./install-misspell.sh -b ~/bin + sh ./install-misspell.sh -b .vendor - name: Run checks run: | BSP=rpi3 bundle exec ruby utils/devtool.rb clippy diff --git a/contributor_setup.sh b/contributor_setup.sh index d379dba7..8bad881f 100755 --- a/contributor_setup.sh +++ b/contributor_setup.sh @@ -2,7 +2,35 @@ git config core.hooksPath .githooks +# +# Ruby and Bundler +# +if ! command -v bundle &> /dev/null +then + echo "'bundle' could not be found. Please install Ruby and Bundler." + exit +fi bundle config set path '.vendor/bundle' bundle install +# +# NPM +# +if ! command -v npm &> /dev/null +then + echo "'npm' could not be found. Please install it." + exit +fi npm install --save-dev --save-exact prettier + +# +# Misspell +# +if ! command -v curl &> /dev/null +then + echo "'curl' could not be found. Please install it." + exit +fi +curl -L -o ./install-misspell.sh https://git.io/misspell +sh ./install-misspell.sh -b .vendor +rm install-misspell.sh diff --git a/utils/devtool.rb b/utils/devtool.rb index 47e3404a..66271202 100755 --- a/utils/devtool.rb +++ b/utils/devtool.rb @@ -165,7 +165,7 @@ class DevTool def misspell puts 'Misspell'.light_blue - exit(1) unless system("~/bin/misspell -error #{tracked_files.join(' ')}") + exit(1) unless system(".vendor/misspell -error #{tracked_files.join(' ')}") end def rubocop