From 223d5655065b1e37ea7434202b4375354ac8d4f6 Mon Sep 17 00:00:00 2001 From: Martin Geisler Date: Sat, 5 Oct 2024 21:00:37 +0900 Subject: [PATCH 1/5] Generate PR suggestions when formatting is wrong This should make it much easier to do drive-by changes in the GitHub editor: the comment should contain a diff that can be committed directly from the online editor. --- .github/workflows/build.yml | 11 +++++++++-- README.md | 9 +++++---- 2 files changed, 14 insertions(+), 6 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index fa31357bdd4c..f7c476865546 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -21,14 +21,21 @@ jobs: run: | sudo apt update sudo apt install gettext yapf3 + curl -fsSL https://dprint.dev/install.sh | sh + echo "/home/runner/.dprint/bin" >> $GITHUB_PATH - name: Install nightly rustfmt run: | rustup default nightly rustup component add rustfmt - - name: Check formatting - uses: dprint/check@v2.2 + - name: Reformat + run: dprint fmt + + - uses: parkerbxyz/suggest-changes@v1 + + - name: Check if there were any changes + run: git diff --exit-code typos: runs-on: ubuntu-latest diff --git a/README.md b/README.md index aaaa75ccc666..ac8f28288947 100644 --- a/README.md +++ b/README.md @@ -43,19 +43,20 @@ Articles and blog posts from around the web which cover Comprehensive Rust: _[In Search of Rust Developers, Companies Turn to In-House Training](https://www.darkreading.com/application-security/google-microsoft-take-refuge-in-rust-languages-better-security)_. About how Microsoft, Google, and others are training people in Rust. -## Building +Building +-------- The course is built using a few tools: -- [mdbook](https://github.com/rust-lang/mdBook) -- [mdbook-svgbob](https://github.com/boozook/mdbook-svgbob) +* [mdbook](https://github.com/rust-lang/mdBook) +* [mdbook-svgbob](https://github.com/boozook/mdbook-svgbob) - [mdbook-i18n-helpers and i18n-report](https://github.com/google/mdbook-i18n-helpers) - [mdbook-exerciser](mdbook-exerciser/) - [mdbook-course](mdbook-course/) In addition, [mdbook-linkcheck](https://github.com/Michael-F-Bryan/mdbook-linkcheck) checks -the internal links. +the internal links. First install Rust by following the instructions on https://rustup.rs/. Then clone this repository: From 4155f60b4461269d431fae67f832740d27636043 Mon Sep 17 00:00:00 2001 From: Martin Geisler Date: Sat, 5 Oct 2024 14:06:18 +0200 Subject: [PATCH 2/5] Apply suggestions from code review Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> --- README.md | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/README.md b/README.md index ac8f28288947..6cf596300ad5 100644 --- a/README.md +++ b/README.md @@ -43,8 +43,7 @@ Articles and blog posts from around the web which cover Comprehensive Rust: _[In Search of Rust Developers, Companies Turn to In-House Training](https://www.darkreading.com/application-security/google-microsoft-take-refuge-in-rust-languages-better-security)_. About how Microsoft, Google, and others are training people in Rust. -Building --------- +## Building The course is built using a few tools: From 23fc1fb0b379ab37025d33cb977a8aa181829eba Mon Sep 17 00:00:00 2001 From: Martin Geisler Date: Sat, 5 Oct 2024 14:06:32 +0200 Subject: [PATCH 3/5] Update README.md Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> --- .github/workflows/build.yml | 7 ++++--- README.md | 6 +++--- 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index f7c476865546..32e85c7dccd7 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -29,12 +29,13 @@ jobs: rustup default nightly rustup component add rustfmt - - name: Reformat + - name: Format the project run: dprint fmt - - uses: parkerbxyz/suggest-changes@v1 + - name: Add PR suggestions for formatting changes + uses: parkerbxyz/suggest-changes@v1 - - name: Check if there were any changes + - name: Check for changes run: git diff --exit-code typos: diff --git a/README.md b/README.md index 6cf596300ad5..aaaa75ccc666 100644 --- a/README.md +++ b/README.md @@ -47,15 +47,15 @@ Articles and blog posts from around the web which cover Comprehensive Rust: The course is built using a few tools: -* [mdbook](https://github.com/rust-lang/mdBook) -* [mdbook-svgbob](https://github.com/boozook/mdbook-svgbob) +- [mdbook](https://github.com/rust-lang/mdBook) +- [mdbook-svgbob](https://github.com/boozook/mdbook-svgbob) - [mdbook-i18n-helpers and i18n-report](https://github.com/google/mdbook-i18n-helpers) - [mdbook-exerciser](mdbook-exerciser/) - [mdbook-course](mdbook-course/) In addition, [mdbook-linkcheck](https://github.com/Michael-F-Bryan/mdbook-linkcheck) checks -the internal links. +the internal links. First install Rust by following the instructions on https://rustup.rs/. Then clone this repository: From b08e5c37a2d6d90b57a704667099d2c0dd7af9f8 Mon Sep 17 00:00:00 2001 From: Martin Geisler Date: Mon, 7 Oct 2024 00:00:54 +0900 Subject: [PATCH 4/5] Introduce extra whitespace --- .github/workflows/build.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 32e85c7dccd7..6159caa40415 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -35,6 +35,9 @@ jobs: - name: Add PR suggestions for formatting changes uses: parkerbxyz/suggest-changes@v1 + + + - name: Check for changes run: git diff --exit-code From c41e9ea9d6040f679810d0383b4b762c7ee20f7f Mon Sep 17 00:00:00 2001 From: Martin Geisler Date: Fri, 11 Oct 2024 08:48:50 +0200 Subject: [PATCH 5/5] Update .github/workflows/build.yml Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> --- .github/workflows/build.yml | 3 --- 1 file changed, 3 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 6159caa40415..32e85c7dccd7 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -35,9 +35,6 @@ jobs: - name: Add PR suggestions for formatting changes uses: parkerbxyz/suggest-changes@v1 - - - - name: Check for changes run: git diff --exit-code