Skip to content

Commit 223d565

Browse files
committed
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.
1 parent 7a25c4a commit 223d565

File tree

2 files changed

+14
-6
lines changed

2 files changed

+14
-6
lines changed

.github/workflows/build.yml

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,14 +21,21 @@ jobs:
2121
run: |
2222
sudo apt update
2323
sudo apt install gettext yapf3
24+
curl -fsSL https://dprint.dev/install.sh | sh
25+
echo "/home/runner/.dprint/bin" >> $GITHUB_PATH
2426
2527
- name: Install nightly rustfmt
2628
run: |
2729
rustup default nightly
2830
rustup component add rustfmt
2931
30-
- name: Check formatting
31-
uses: dprint/[email protected]
32+
- name: Reformat
33+
run: dprint fmt
34+
35+
- uses: parkerbxyz/suggest-changes@v1
36+
37+
- name: Check if there were any changes
38+
run: git diff --exit-code
3239

3340
typos:
3441
runs-on: ubuntu-latest

README.md

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -43,19 +43,20 @@ Articles and blog posts from around the web which cover Comprehensive Rust:
4343
_[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)_.
4444
About how Microsoft, Google, and others are training people in Rust.
4545

46-
## Building
46+
Building
47+
--------
4748

4849
The course is built using a few tools:
4950

50-
- [mdbook](https://github.com/rust-lang/mdBook)
51-
- [mdbook-svgbob](https://github.com/boozook/mdbook-svgbob)
51+
* [mdbook](https://github.com/rust-lang/mdBook)
52+
* [mdbook-svgbob](https://github.com/boozook/mdbook-svgbob)
5253
- [mdbook-i18n-helpers and i18n-report](https://github.com/google/mdbook-i18n-helpers)
5354
- [mdbook-exerciser](mdbook-exerciser/)
5455
- [mdbook-course](mdbook-course/)
5556

5657
In addition,
5758
[mdbook-linkcheck](https://github.com/Michael-F-Bryan/mdbook-linkcheck) checks
58-
the internal links.
59+
the internal links.
5960

6061
First install Rust by following the instructions on https://rustup.rs/. Then
6162
clone this repository:

0 commit comments

Comments
 (0)